I have 2 different area in my website. Site area, and Admin area. Both have different different login function to start the session and set cookies, and also logout function to delete the cookie and destroy the session.
So for example:
login:
function siteLogin(){
...
session_name('siteLogin');
session_start();
}
function adminLogin(){
...
session_name('adminLogin');
session_start();
}
logout:
function siteLogout(){
...
session_name('siteLogin');
session_start();
session_destroy();
}
function adminLogout(){
...
session_name('adminLogin');
session_start();
session_destroy();
}
The problem: If i'm logged in in both areas, and i logout from one, i get logged out in both.
The question: How i can prevent that? So if i logout from one, i stay logged in in the other?
session_destroy()(only the data). Are you manually deleting the cookie in your logout methods? - George Cummins$_SESSION['site']['data'],$_SESSION['admin']['data'], and thenunset($_SESSION['admin'])? - Fr0z3n