|
|
Q1368 Can I access a cookie that is created in a different page than the current page?
irt.org | Knowledge Base | JavaScript | Cookie | Q1368 [ previous next ] Q1368 Can I access a cookie that is created in a different page than the current page?Yes. If its in a different directory then you may need to set the path property of the cookie so that it is high enough in the directory tree not to prevent a document in one part of the directory tree from being excluded. For example, if you set the path to: /topdir/dir1 then files in /topdir/dir2 will not be able to access the cookie. But if you set the path to: /topdir Then files in all sub-directories of topdir will have access. By default the path is set to: / Which means all files on the server have access to the cookie. You set the path of the cookie by passing a path value to a function similar to the one below:
|
-- div -->
|