Re: sessions timeout
| From: | André Ventura Lemos | Date: | Tue, 09 Mar 2004 23:41:04 +0000 |
| Subject: | Re: sessions timeout | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-179949@lists.php.net to get a copy of this message | ||
But my question is, since I don't deal with cookies directly (PHP does
that for me), 'cause I only have to deal with sessions, how can I change
the cookies produced by PHP?
atm I only session_start() and use the $_SESSION[''], so I don't really
know which cookie to change, or how to do it.
TIA
Ps.: I know it doesn't last forever, that's why I've put the _forever_
;-)
On Tue, 2004-03-09 at 23:12, Richard Davey wrote:
> Hello André,
>
> Tuesday, March 9, 2004, 10:53:35 PM, you wrote:
>
> AVL> I'm using sessions to manage users, by using cookies to store the
> AVL> session.
> AVL> My question is, how do I make the session last _forever_?
> AVL> ATM the session lasts 'till the user closes the browser.
>
> Ok first of all - you cannot make a cookie last "forever". You can set
> its expiry to be a ridiculous date in the future, but that's all - if
> the browser removes it during cookie purging, or the user reinstalls
> something - it's gone. One of the best solutions is to refresh the
> cookie (without their knowledge) each time they come back to the site.
>
> Anyway, onto the meat of your question - give the cookie an expiry
> date well into the future so it persists until the visitor returns.
> Look at the help file for details on the attributes you need for
> setcookie.
>
> --
> Best regards,
> Richard Davey
> http://www.phpcommunity.org/wiki/296.html
--
I/O, I/O,
It's off to disk I go,
A bit or byte to read or write,
I/O, I/O, I/O...
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc