CodeIgniter Forums
ci_session - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: ci_session (/showthread.php?tid=1888)



ci_session - El Forum - 07-03-2007

[eluser]St0neyx[/eluser]
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.


ci_session - El Forum - 07-03-2007

[eluser]Jamongkad[/eluser]
Why don't you try session_destroy();


ci_session - El Forum - 07-03-2007

[eluser]modano[/eluser]
http://ellislab.com/codeigniter/user-guide/libraries/sessions.html

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

Smile


ci_session - El Forum - 07-03-2007

[eluser]St0neyx[/eluser]
[quote author="Jamongkad" date="1183479214"]Why don't you try session_destroy();[/quote]

I don't use session_destroy() because as I explained it's not an php session but an cookie. :down:
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.

[quote author="modano" date="1183483624"]
“The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie.”
[/quote]

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