note 42319 added to function.setcookie
| From: | z_malloc_overflow at hotmail dot com | Date: | Wed, 12 May 2004 01:45:29 +0000 |
| Subject: | note 42319 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69500@lists.php.net to get a copy of this message | ||
At some point during a version change this..
setcookie("PHPSESSID","","/","yourdomain.com");
became unacceptable and would result in this warning :
Warning: setcookie() expects parameter 3 to be long, string given in /var/www/yourscript.php on line
2
To set a 'per session' based cookie with no expiration, use zero. You must typecast in
this loosely typed language in this case.
setcookie("PHPSESSID",0,"/","yourdomain.com");
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42319
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42319&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42319&report=yes
Search -- http://master.php.net/manage/user-notes.php