| re: JavaScript cookies (in subdirectories) and PHP file
"duane" <duawaktu@hotmail.com> schreef in bericht
news:592d2609.0309161452.744046bf@posting.google.c om...[color=blue]
>
> I have a problem with my JS cookies. I am setting cookies in files
> located in two different directories, e.g. one in ROOT, one in
> ROOT/dir1/dir2. The cookies are then sent to PHP file (server-side)
> which writes their values to a textfile, e.g. OUT.txt.
>[/color]
How do you write the cookies to the text file?
[color=blue]
> The cookies that are in ROOT are working perfectly. No problem. The
> cookies set in ROOT/dir1/dir2, however, "seemed" to be set and read
> correctly, although
> they are never written into OUT.txt in the server. I have used:
>
> javascript.alert(document.cookie);
>[/color]
Be aware that when testing cookies this way, they will be available before
the cookie header is send. This is because in JavaScript, 'document' is an
object and 'cookie' a property of this object.
In PHP, the cookie is available not sooner then after a reload of the page.
JW |