RE: [PHP] PHP and Cookies
| From: | John W. Holmes | Date: | Fri, 04 Apr 2003 03:57:13 +0000 |
| Subject: | RE: [PHP] PHP and Cookies | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142245@lists.php.net to get a copy of this message | ||
> I have a problem with php and cookies. I use the following line of
code
> to set a cookie to expire in one year:
>
>
setcookie('gsp_email',$_POST['requiredsubEmail'],time()*60*60*24*365
> ,'/','',0);
>
> The idea is that the cookie will sit on the client for a year, so that
a
> visitor only has to submit their email address once.
>
> However, when I close up all browser windows, then reload the browser
(I'm
> using IE 6), the cookie doesn't seem to 'stick'.. I'm once again asked
for
> my email address even though I already entered it and set the cookie.
If you set your cookie settings to "prompt" do you receive the cookie?
How are you checking for it later, to decide whether or not to prompt
for an email?
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/