[FX.php List] Extending Session Expiration
Gary Sprung
gary at gnurps.com
Wed Jan 24 10:32:16 MST 2007
Jonathan,
How does that stop the server's garbage collection, which deletes
session files, starting at 24 minutes (the PHP default) of session
inactivity? It looks like you are just creating your own session
variables, so I don't see it affecting the system's deletion of
sessions. Seems like what you're doing is looking for session
expiration and starting a new session. Wouldn't that lose any pre-
defined session variables? If the session is expired, then isn't the
value of $_SESSION['sess_exp_time'] actually NULL? That would mean
your test upon reload is if(time() > 0), which would be true.
GS
On Jan 23, 2007, at 7:07 PM, Jonathan Schwartz wrote:
> Hi Gary,
>
> I've never messed with the system settings. I just set the session
> as follows once the user logs in. This codes only gets executed once.
>
> $_SESSION['sess_start_time']= time();
> $_SESSION['sess_exp_time']=time() + 3600;
>
> Then, whenever a user advances to a new page in session, I test for
> expired session:
>
> if(time() >= $_SESSION['sess_exp_time'] ){
> Do this; //exit or some other action.
> }
>
> Works for me.
>
> Jonathan
>
--------
Gary Sprung
GNURPS Consulting
gary at gnurps.com
www.gnurps.com
Landline: 720-565-9933
Cell: 303-859-9331
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20070124/7e6ca603/attachment.html
More information about the FX.php_List
mailing list