Resending session cookies patch

From: Date: Wed, 14 May 2008 02:40:51 +0000
Subject: Resending session cookies patch
Groups: php.internals 
Request: Send a blank email to internals+get-37642@lists.php.net to get a copy of this message
Here is a patch that will add an ini setting (session.cookie_resend) to resend session cookies whenever a session is started. The point of this is to keep a cookie's expiration fresh as users use a site. Currently, once a session is started, it will expire after cookie_lifetime no matter what. For my applications, I need that cookie to only expire after cookie_lifetime of non use. I also added a function called session_send_cookie() that will send the cookie right then in case you don't have access to the ini settings or want to make that customized based on events in your application. The only caveat of this is that currently session_send_cookie() will send the Set-Cookie header every time it is called. There is no flag in the _php_ps_globals struct to indicate that a cookie has been sent other than PS(send_cookie). However, I can't rely on that because if the session is found and session.cookie_resend is 0 PS(send_cookie) is set to 0 already. I could add a new flag (cookie_sent?) and track that anywhere that php_session_send_cookie is called or even inside php_session_send_cookie. But, the coding style of this file did not seem to favor altering PS() inside that function. It does not currently check PS(send_cookie). It simply just fires off the Set-Cookie header. Thoughts? -- Brian Moon Senior Developer/Engineer ------------------------------ When you care enough to spend the very least. http://dealnews.com/

« previous php.internals (#37642) next »