How do I delete PHPSESSID on client computers

前端 未结 13 1560
滥情空心
滥情空心 2020-12-30 22:50

UPDATE ON THE PROBLEM:

  • On some browsers, we have two PHPSESSIDs.
  • One PHPSESSID is not set by me anywhere in my script
  • It has
13条回答
  •  醉梦人生
    2020-12-30 23:29

    The solution will be let users go to /folder path for the duration of session expire time. On this path make php script for copying ALL COOKIES from /folder to / path by using setcookie function (http://php.net/manual/ro/function.setcookie.php)

    foreach ($_COOKIE as $key => $value) {
        setcookie($key, $value, $expire, "/")
    }
    // redirect to "/" now. User will be able to login.
    

    Additional explanation: cookies are tied to path and domain, its important (and by default its /, but it seems not in your case). So PHPSESSID from subpath (like /folder or /me) not accessible from parent. And they propagate from parent to child. So cookies from /me are the same as for / with there not assigned explicit.

提交回复
热议问题