mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix for bug when destroying a session with a domain cookie. See http://www.silverstripe.org/general-questions/show/18539 for more details
This commit is contained in:
parent
d30b4b1d00
commit
77f5ea733b
@ -448,7 +448,17 @@ class Session {
|
|||||||
public static function destroy($removeCookie = true) {
|
public static function destroy($removeCookie = true) {
|
||||||
if(session_id()) {
|
if(session_id()) {
|
||||||
if($removeCookie) {
|
if($removeCookie) {
|
||||||
setcookie(session_name(), '');
|
$path = self::get_cookie_path();
|
||||||
|
$domain = self::get_cookie_domain();
|
||||||
|
$secure = self::get_cookie_secure();
|
||||||
|
|
||||||
|
if($domain) {
|
||||||
|
setcookie(session_name(), '', null, $path, $domain, $secure, true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setcookie(session_name(), '', null, $path, null, $secure, true);
|
||||||
|
}
|
||||||
|
|
||||||
unset($_COOKIE[session_name()]);
|
unset($_COOKIE[session_name()]);
|
||||||
}
|
}
|
||||||
session_destroy();
|
session_destroy();
|
||||||
|
Loading…
Reference in New Issue
Block a user