Skip to content
Snippets Groups Projects
Commit 53c4a552 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #21577 from owncloud/make-code-cleaner-by-removing-unrequired-security-features

Remove code related to session regeneration after some time
parents 21a700bc 74876fa6
No related branches found
No related tags found
No related merge requests found
...@@ -431,20 +431,10 @@ class OC { ...@@ -431,20 +431,10 @@ class OC {
//show the user a detailed error page //show the user a detailed error page
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
OC_Template::printExceptionErrorPage($e); OC_Template::printExceptionErrorPage($e);
die();
} }
$sessionLifeTime = self::getSessionLifeTime(); $sessionLifeTime = self::getSessionLifeTime();
// regenerate session id periodically to avoid session fixation
/**
* @var \OCP\ISession $session
*/
$session = self::$server->getSession();
if (!$session->exists('SID_CREATED')) {
$session->set('SID_CREATED', time());
} else if (time() - $session->get('SID_CREATED') > $sessionLifeTime / 2) {
$session->regenerateId();
$session->set('SID_CREATED', time());
}
// session timeout // session timeout
if ($session->exists('LAST_ACTIVITY') && (time() - $session->get('LAST_ACTIVITY') > $sessionLifeTime)) { if ($session->exists('LAST_ACTIVITY') && (time() - $session->get('LAST_ACTIVITY') > $sessionLifeTime)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment