Welcome Guest, Not a member yet? Register   Sign In
Session expire from server command line


Is it possible to manually force a session expire from server command line?  (i use Linux with Apache2 and CodeIgniter v2.2.6)

thanks in advance,


you cant. because browser and CLI is treated as different user.

this like you want destroy firefox session with your chrome session.

if you really to do that. you can delete your browser cache to destroy your browser session using CLI

Delete the contents of the specified folder:

$ rm -Rf /var/lib/php/session/*
Now all of the current user sessions should be cleared. If you store sessions in the DB or memory, you will need to clear the sessions manually via whatever software you use for session management.

(This post was last modified: 12-28-2017, 04:51 AM by InsiteFX.)


And then what happens if he has sessions that are active?

You should never just tell someone to delete a folder without first telling
them to make a backup of that folder!

Also you can delete the sessions by checking to see if they are active using
a CodeIgniter method, because i wrote one for checking the database sessions.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

CI2 sessions relied exclusively on cookies, so no - not possible.
Yet another reason to upgrade.

Theme © iAndrew 2016 - Forum software by © MyBB