|
|
@@ -189,11 +189,8 @@ class OtAuthenticationService extends AbstractAuthenticationService
|
|
|
* Update the guzzle cookie jar with the current session's ones
|
|
|
*/
|
|
|
private function fillCookieJar() {
|
|
|
-
|
|
|
foreach (['BEARER', 'SFSESSID'] as $cookieName) {
|
|
|
- if (array_key_exists($cookieName, $_COOKIE) &&
|
|
|
- $this->jar->getCookieByName($cookieName) == null) {
|
|
|
-
|
|
|
+ if (array_key_exists($cookieName, $_COOKIE)) {
|
|
|
$cookie = new SetCookie();
|
|
|
$cookie->setName($cookieName);
|
|
|
$cookie->setValue($_COOKIE[$cookieName]);
|
|
|
@@ -251,11 +248,16 @@ class OtAuthenticationService extends AbstractAuthenticationService
|
|
|
$value = $cookie->getValue();
|
|
|
$expires = $cookie->getExpires();
|
|
|
$path = $cookie->getPath();
|
|
|
- $domain = $_SERVER['HTTP_HOST'];
|
|
|
$secure = $cookie->getSecure();
|
|
|
$httpOnly = $cookie->getHttpOnly();
|
|
|
|
|
|
- setcookie($name, $value, $expires, $path, $domain, $secure, $httpOnly);
|
|
|
+ $_COOKIE[$name] = $value;
|
|
|
+ setcookie($name, $value, $expires, $path, self::COOKIE_DOMAIN, $secure, $httpOnly);
|
|
|
+ setcookie($name, $value, $expires, $path, '.' . self::COOKIE_DOMAIN, $secure, $httpOnly);
|
|
|
+
|
|
|
+ if (!preg_match('/(.*\.)?opentalent\.fr/', $_SERVER['HTTP_HOST'])) {
|
|
|
+ setcookie($name, $value, $expires, $path, $_SERVER['HTTP_HOST'], $secure, $httpOnly);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|