Gast Posted July 27, 2006 Share Posted July 27, 2006 I want to be able to destroy a session from another user, i.e. An administrator can log other users out. Is it possible to use the session ID to do this as i have this stored? Quote Link to comment https://forums.phpfreaks.com/topic/15809-destroying-a-session-started-by-someone-else/ Share on other sites More sharing options...
bltesar Posted July 27, 2006 Share Posted July 27, 2006 The following code should do it:[code]//end any open sessionssession_write_close();//start session to be destroyedsession_id($id_of_session_to_destroy);session_start();//dstroy the session$_SESSION=array();session_destroy();[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15809-destroying-a-session-started-by-someone-else/#findComment-64697 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.