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

Hi!

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,

-PetePot-
Reply
#2

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
Reply
#3

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.
Reply
#4

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

@XtreemDeveloper

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 )
Reply
#5

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




Theme © iAndrew 2016 - Forum software by © MyBB