开发者

Php session_destroy() is destroying all sessions in a browser

开发者 https://www.devze.com 2023-03-31 15:11 出处:网络
I have two admin panels with different files and folders and when i destroying session after logging out from one admin panelit automatically destroying the other admin panel session, they both have d

I have two admin panels with different files and folders and when i destroying session after logging out from one admin panel it automatically destroying the other admin panel session, they both have different session names and variables .

session_unset($_SESSION['ticket_level']); session_unset($_SESSION['ticket_name']); 开发者_JAVA技巧 session_destroy(); header("location: ../login.php");

this is something i am using for one of them , i am not sure what the heck is going on or is this the right way to do it for not


Use session_name() for different applications running on the same server. Ex:

Site A:

session_name('site_A');

Site B

session_name('site_B');

You must call it before session_start() and on every single page.


Try to use

unset($_SESSION['ticket_level']);

session_unset is obsolet and is not meant to be used like this (it takes void as params)

0

精彩评论

暂无评论...
验证码 换一张
取 消