note 35084 added to function.setcookie
| From: | php at 4tune dot net | Date: | Tue, 19 Aug 2003 08:54:18 +0000 |
| Subject: | note 35084 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-54640@lists.php.net to get a copy of this message | ||
I noticed some inconsistent behaviour (which may just be me doing somthing stupid of course) when
using both PHP and javascript on the same cookies.
I use a tree-like menu system which remembers the last item selected in a cookie. I want to reset
the cookie on login to the default menu option - which means I use setcookie from php to send the
default cookie value.
However, my cookie value has a SPACE in it and javascript encodes this using %20 and PHP encodes
this using +.
As a result the javascript cannot read the cookie value sent from PHP. Of course, if someone has a
good tip on how to work around this little problem I would be only tooooo happy to hear it...
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35084
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35084&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35084&report=yes