NYCPHP Meetup

NYPHP.org

[nycphp-talk] Session cookie expiration issue

Stephen Musgrave stephen at musgrave.org
Wed Mar 8 17:53:23 EST 2006


> The statement session_start() is only used once per script -- I don't
> know if it's reactivated by calling it from another script or not.

Nope, that's not the case.  I did a search and it's only in my config  
file

> You could try activating session_start() and then regenerating
> another session_id() by using session_regenerate_id(). It goes like
> this:

I experimented with that and it seemed to work just fine, but it  
seems like overhead that I didn't want to incur right away.  ;-)   
Plus, it might be harder to debug another problem down the line if  
the session ID of the client is constantly changing?

> Another idea, to maintain the session state, is you might try using
> cookies by sending a cookie with the name PHPSESSID to the client.
> However, you need to have session_use_cookie = 1 in your php.int.

The session ID is definitely on the client as a cookie.  This app is  
in a closed environment, so I can count on that.

Thanks again for your ideas,

Stephen



More information about the talk mailing list