return to old setcookie() because the new parameter $options requires php 7.3

This commit is contained in:
Uwe Steinmann 2020-05-26 14:51:58 +02:00
parent 3b0037649d
commit 5d5a7da2d0

View File

@ -61,7 +61,7 @@ if (!isset($_COOKIE["mydms_session"])) {
$dms_session = $_COOKIE["mydms_session"];
$session = new SeedDMS_Session($db);
if(!$resArr = $session->load($dms_session)) {
setcookie("mydms_session", $dms_session, array('expires'=>time()-3600, 'path'=>$settings->_httpRoot)); //delete cookie
setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot); //delete cookie
header("Location: " . $settings->_httpRoot . "out/out.Login.php?referuri=".$refer);
exit;
}
@ -74,7 +74,7 @@ if((int)$resArr['lastAccess']+60 < time())
/* Load user data */
$user = $dms->getUser($resArr["userID"]);
if (!is_object($user)) {
setcookie("mydms_session", $dms_session, array('expires'=>time()-3600, 'path'=>$settings->_httpRoot)); //delete cookie
setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot); //delete cookie
header("Location: " . $settings->_httpRoot . "out/out.Login.php?referuri=".$refer);
exit;
}
@ -145,5 +145,5 @@ if (!$user->isAdmin()) {
if($settings->_cookieLifetime) {
$lifetime = time() + intval($settings->_cookieLifetime);
/* Turn off http only cookies if jumploader is enabled */
setcookie("mydms_session", $dms_session, array('expires'=>$lifetime, 'path'=>$settings->_httpRoot, 'httponly'=>!$settings->_enableLargeFileUpload));
setcookie("mydms_session", $dms_session, $lifetime, $settings->_httpRoot, null, null, !$settings->_enableLargeFileUpload);
}