Hello,
I need to destroy all sessions when logging out of a system, except for just one ... would anyone know how to implement this with php?
For example:
-
Let's say I have 5 active sessions when the user is logged in:
$session1 = $_SESSION['session1']; $session2 = $_SESSION['session2']; $session3 = $_SESSION['session3']; $session4 = $_SESSION['session4']; $session5 = $_SESSION['session5'];
-
When I log out, I want to destroy 4 of these sessions, but there is one that I need to keep active ... how would it look like in this part? I tried it like this:
session_start(); if(!isset($_SESSION['session4'])){ session_destroy(); }//end if
- so it did not work ... what would be the right one?