6

I want to add something like Logout all active Logins in to my system from administrators

I have some case when Admin changes in permission of users , I am storing permissions in SESSION ,

So I want to make log out all the users when ADMIN Press event

Something like in Google we have option that log out from other devices.

one way I can find that I can set one GLOBAL variable and every time I will check it when I fire AJAX in every 1 min after log-in

is there another way to do this which is more standard .

Cœur
  • 37,241
  • 25
  • 195
  • 267
Chintan Gor
  • 1,062
  • 2
  • 15
  • 35

2 Answers2

1

you should identify where the user's sessions are stored. If your web server is using files (see your php.ini) then deleting this files will make a brutal destroy of all the user's sessions.

C.Vergnaud
  • 857
  • 6
  • 15
0

I had a similar scenario where I needed to force logout the user via PHP.

C.Vergnaud suggestion worked fine but just to complement his answer, look for session.save_path inside the file php.ini.

Alternatively, you may use the function session_save_path() to get this path from PHP.

Tyler2P
  • 2,324
  • 26
  • 22
  • 31
Leicam
  • 1
  • 1