mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Merge pull request #19874 from owncloud/delete-cookie-instead-of-setting-value-to-empty
Delete cookie instead of emptying value
This commit is contained in:
commit
64dc222ce5
2 changed files with 7 additions and 2 deletions
|
|
@ -427,7 +427,8 @@ class OC {
|
|||
// session timeout
|
||||
if ($session->exists('LAST_ACTIVITY') && (time() - $session->get('LAST_ACTIVITY') > $sessionLifeTime)) {
|
||||
if (isset($_COOKIE[session_name()])) {
|
||||
setcookie(session_name(), '', time() - 42000, $cookie_path);
|
||||
setcookie(session_name(), null, -1, self::$WEBROOT ? : '/');
|
||||
unset($_COOKIE[session_name()]);
|
||||
}
|
||||
session_unset();
|
||||
session_destroy();
|
||||
|
|
|
|||
|
|
@ -41,7 +41,11 @@ class Internal extends Session {
|
|||
public function __construct($name) {
|
||||
session_name($name);
|
||||
set_error_handler(array($this, 'trapError'));
|
||||
session_start();
|
||||
try {
|
||||
session_start();
|
||||
} catch (\Exception $e) {
|
||||
setcookie(session_name(), null, -1, \OC::$WEBROOT ? : '/');
|
||||
}
|
||||
restore_error_handler();
|
||||
if (!isset($_SESSION)) {
|
||||
throw new \Exception('Failed to start session');
|
||||
|
|
|
|||
Loading…
Reference in a new issue