Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Menu and Security » Multiple Sessions and Logging Out
Multiple Sessions and Logging Out [message #8] Fri, 14 April 2006 02:52 Go to previous message
ljkbrost is currently offline  ljkbrost
Messages: 59
Registered: April 2006
Member
I have read the article on the Client Clones and Server Sessions (http://www.tonymarston.net/php-mysql/client-clones.html) about the creation of multiple sessions for a single logon instance.

I have played with the creation of sessions and it works great. I think that there is a problem with the logout link though. When I click the logout link, I'm returned to the logon screen for that session and all of the session data is deleted. But... The other sessions still work. I think that the "logout" link should really be "end session" and the "logout" link should kill all of the sessions.

I have created a function called destroyAllSessions() - listed below - that gets called when clicking "logout" and altered the old logout code to get called when clicking "end session".

I tested this code by opening up multiple sessions and clicking logout in one of the sessions. When you attempt to navigate to any other page from the unlogged out sessions, they all return to the login screen saying you need to login.

I hope this change can be rolled into the framework.

Cheers,


Kyle Brost
----
// ************************************************************ ****************
function destroyAllSessions ($prefix='menu')
// create a new session name using $prefix + a number.
{
foreach($_COOKIE as $session_name => $session_id)
{
session_name($session_name);
$_SESSION = array();
setcookie(session_name(), '', time()-42000, '/');
session_destroy();
}

session_write_close();
return $session_name;
} // destroyAllSessions
 
Read Message
Read Message
Read Message
Read Message
Read Message
Next Topic: Proc as Start Task?
Goto Forum:
  


Current Time: Wed Nov 27 12:17:28 EST 2024

Total time taken to generate the page: 0.07394 seconds