note 20522 added to function.setcookie
| From: | andreas dot schempp at gmx dot ch | Date: | Sat, 06 Apr 2002 11:33:13 +0000 |
| Subject: | note 20522 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-28697@lists.php.net to get a copy of this message | ||
I want to use cookies to store login information for my site, so I used
setcookie("loginid","$id").
It works fine, as long as I do not close my browser.
Whenever I come back to the Site, all informations are lost.
Then I tested around with the comments here, and finaly I realized that it is important to send your
domain. It is also important that you send your real domain, I'm using Apache with various
Virtual Hosts, I had to send the Virtual Host Domain, even if you have a redirect.
Now I'm using
setcookie("loginid","$id",time()+3600,"/","someone.no-ip.com")
Also, it't not working if im adding a 1 for secure at the end.
--
http://www.php.net/manual/en/function.setcookie.php
http://master.php.net/manage/user-notes.php?action=edit+20522
http://master.php.net/manage/user-notes.php?action=delete+20522
http://master.php.net/manage/user-notes.php?action=reject+20522