Jump to content

Archived

This topic is now archived and is closed to further replies.

Gast

Destroying a session started by someone else

Recommended Posts

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?

Share this post


Link to post
Share on other sites
The following code should do it:


[code]
//end any open sessions
session_write_close();

//start session to be destroyed
session_id($id_of_session_to_destroy);
session_start();

//dstroy the session
$_SESSION=array();
session_destroy();
[/code]


Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.