Part of the EllisLab Network
   
 
ci_session
Posted: 03 July 2007 03:04 AM   [ Ignore ]  
Summer Student
Total Posts:  17
Joined  03-26-2007

Hi,

I build an login system/script that sets the session..
Now i checked some stuff and found out that if you close your browser and restart the session still exists.
I know the session is not an session in the normal php session way.

Where is this session stored? and how do I kill/destroy the session on browser close?
Would be nice when you forgot to logout the system does it for you.

edit:

I know i can set an expiration for the session in the config, but still i want to kill the session when the browser is closed.

Profile
 
 
Posted: 03 July 2007 06:13 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Avatar
Rank
Total Posts:  89
Joined  06-05-2007

Why don’t you try session_destroy();

 Signature 

Functional PHP Extension A set of higher-order functions and other primatives written in PHP (3/4 compatible) which let you write php code in a functional style, similar to the way you might in Haskell, Scheme, or ML.

Profile
 
 
Posted: 03 July 2007 07:27 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  18
Joined  06-10-2007

http://codeigniter.com/user_guide/libraries/sessions.html

“The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie.”

smile

Profile
 
 
Posted: 03 July 2007 07:41 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  17
Joined  03-26-2007
Jamongkad - 03 July 2007 06:13 AM

Why don’t you try session_destroy();

I don’t use session_destroy() because as I explained it’s not an php session but an cookie. downer
Beside that i wanted an way to destroy it when the browser is closed, when i press log out the session changes so the user isn’t logged in anymore, but stays logged in after closing the browser without logging out.

modano - 03 July 2007 07:27 AM

“The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie.”

Yeah i read all that too, but where can i find the cookie and what name does it have..?
i didn’t encrypted it..
I looked for ci_session(the original name the user guide says) cookie in cookie folder, but no cookie there

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 64457 Total Logged-in Users: 11
Total Topics: 80968 Total Anonymous Users: 0
Total Replies: 435701 Total Guests: 175
Total Posts: 516669    
Members ( View Memberlist )