mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #115 from joaosantos81/patch-1
Fix for bug when destroying a session with a domain cookie. See http://w...
This commit is contained in:
commit
d9fcbf9167
@ -448,7 +448,17 @@ class Session {
|
||||
public static function destroy($removeCookie = true) {
|
||||
if(session_id()) {
|
||||
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()]);
|
||||
}
|
||||
session_destroy();
|
||||
|
Loading…
Reference in New Issue
Block a user