Skip to content
Snippets Groups Projects
Unverified Commit 8ccb6e2e authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Merge $params with cookie params config only when needed.

parent ad53a820
No related branches found
No related tags found
No related merge requests found
...@@ -753,18 +753,16 @@ class SimpleSAML_Session implements Serializable ...@@ -753,18 +753,16 @@ class SimpleSAML_Session implements Serializable
*/ */
public function updateSessionCookies($params = null) public function updateSessionCookies($params = null)
{ {
$sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); assert(is_null($params) || is_array($params));
if (is_array($params) && !empty($params)) { $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler();
$params = array_merge($sessionHandler->getCookieParams(), $params);
} else {
$params = $sessionHandler->getCookieParams();
}
if ($this->sessionId !== null) { if ($this->sessionId !== null) {
$sessionHandler->setCookie($sessionHandler->getSessionCookieName(), $this->sessionId, $params); $sessionHandler->setCookie($sessionHandler->getSessionCookieName(), $this->sessionId, $params);
} }
$params = array_merge($sessionHandler->getCookieParams(), is_array($params) ? $params : array());
if ($this->authToken !== null) { if ($this->authToken !== null) {
$globalConfig = SimpleSAML_Configuration::getInstance(); $globalConfig = SimpleSAML_Configuration::getInstance();
\SimpleSAML\Utils\HTTP::setCookie( \SimpleSAML\Utils\HTTP::setCookie(
......
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