File tree Expand file tree Collapse file tree 2 files changed +18
-14
lines changed
dev/tests/integration/testsuite/Magento/Backend/Model/Auth
lib/internal/Magento/Framework/Session Expand file tree Collapse file tree 2 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 7
7
8
8
/**
9
9
* @magentoAppArea adminhtml
10
+ * @magentoAppIsolation enabled
11
+ * @magentoDbIsolation enabled
10
12
*/
11
13
class SessionTest extends \PHPUnit_Framework_TestCase
12
14
{
Original file line number Diff line number Diff line change 8
8
namespace Magento \Framework \Session ;
9
9
10
10
use Magento \Framework \Session \Config \ConfigInterface ;
11
- use Magento \Framework \Stdlib \Cookie \CookieMetadata ;
12
11
13
12
/**
14
13
* Session Manager
@@ -210,19 +209,22 @@ private function renewCookie()
210
209
if (!$ this ->getCookieLifetime ()) {
211
210
return $ this ;
212
211
}
213
- $ this ->cookieManager ->setPublicCookie (
214
- $ this ->getName (),
215
- $ this ->getSessionId (),
216
- $ this ->cookieMetadataFactory ->createPublicCookieMetadata (
217
- [
218
- CookieMetadata::KEY_DURATION => $ this ->getCookieLifetime (),
219
- CookieMetadata::KEY_DOMAIN => $ this ->sessionConfig ->getCookieDomain (),
220
- CookieMetadata::KEY_PATH => $ this ->sessionConfig ->getCookiePath (),
221
- CookieMetadata::KEY_SECURE => $ this ->sessionConfig ->getCookieSecure (),
222
- CookieMetadata::KEY_HTTP_ONLY => $ this ->sessionConfig ->getCookieHttpOnly ()
223
- ]
224
- )
225
- );
212
+ $ cookieValue = $ this ->cookieManager ->getCookie ($ this ->getName ());
213
+ if ($ cookieValue ) {
214
+ $ metadata = $ this ->cookieMetadataFactory ->createPublicCookieMetadata ();
215
+ $ metadata ->setPath ($ this ->sessionConfig ->getCookiePath ());
216
+ $ metadata ->setDomain ($ this ->sessionConfig ->getCookieDomain ());
217
+ $ metadata ->setDuration ($ this ->sessionConfig ->getCookieLifetime ());
218
+ $ metadata ->setSecure ($ this ->sessionConfig ->getCookieSecure ());
219
+ $ metadata ->setHttpOnly ($ this ->sessionConfig ->getCookieHttpOnly ());
220
+
221
+ $ this ->cookieManager ->setPublicCookie (
222
+ $ this ->getName (),
223
+ $ cookieValue ,
224
+ $ metadata
225
+ );
226
+ }
227
+
226
228
return $ this ;
227
229
}
228
230
You can’t perform that action at this time.
0 commit comments