the cookies toolkit Clear Session Variable code will look like this:
<?php
if ("" == ""){
// WA_ClearSession
$clearAll = TRUE;
$clearThese = explode(",","");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>
you will need to add code before that to store the users ID sesssion in an application variable.
then add code after it to reset the session variable from the application variable.
for the sake of example, lets say the users ID is stored i a session named "userID" when they log in.
the code will look like this:
<?php if(!session_id()) session start(); ?>
<?php $userID = $_SESSION['userID']; ?>
<?php
if ("" == ""){
// WA_ClearSession
$clearAll = TRUE;
$clearThese = explode(",","");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>
<?php session_regenerate_id(); ?>
<?php $_SESSION['userID'] = $userID;
You will have to check your login page to find the correct session name for your case,