TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Destroy Session when close browser (http://www.talkphp.com/general/4709-destroy-session-when-close-browser.html)

Mike 07-09-2009 09:18 PM

Destroy Session when close browser
 
Hi guys, i've been sratching my head finding a way to solve this problem, i have a user login using PHP session, when a user close the browser without login out the session stil remains, so when the user opens the browser again he won't have to log in, cause the session exists yet.

I need to destroy the session when the user closes the browser,
my php.ini has a session.cookie_lifetime = 0 configuration, but the session seems to never expire.

does anyone know a way to do that?

Enfernikus 07-09-2009 09:32 PM

http://us3.php.net/setcookie

Mike 07-09-2009 09:36 PM

yes, i know how to set cookies and i know they're easier to handle, but i want to handle user sessions with php session though :P

Enfernikus 07-09-2009 10:53 PM

It's a no go. PHP sessions are stored on the server but the session id is a cookie. In the process of using sessions you will inevitable use a cookie.


All times are GMT. The time now is 07:29 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0