diff --git a/core/lib/Drupal/Core/Session/SessionManager.php b/core/lib/Drupal/Core/Session/SessionManager.php index 2f3dddc..04f3f99 100644 --- a/core/lib/Drupal/Core/Session/SessionManager.php +++ b/core/lib/Drupal/Core/Session/SessionManager.php @@ -124,16 +124,6 @@ public function start() { } if (empty($result)) { - // Randomly generate a session identifier for this request. This is - // necessary because \Drupal\user\SharedTempStoreFactory::get() wants to - // know the future session ID of a lazily started session in advance. - // - // @todo: With current versions of PHP there is little reason to generate - // the session id from within application code. Consider using the - // default php session id instead of generating a custom one: - // https://www.drupal.org/node/2238561 - $this->setId(Crypt::randomBytesBase64()); - // Initialize the session global and attach the Symfony session bags. $_SESSION = array(); $this->loadSession(); diff --git a/core/modules/user/src/PrivateTempStore.php b/core/modules/user/src/PrivateTempStore.php index 51585cb..5491e92 100644 --- a/core/modules/user/src/PrivateTempStore.php +++ b/core/modules/user/src/PrivateTempStore.php @@ -12,7 +12,6 @@ use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface; use Drupal\Core\Lock\LockBackendInterface; use Drupal\Core\Session\AccountProxyInterface; -use Symfony\Component\HttpFoundation\RequestStack; /** * Stores and retrieves temporary data for a given owner. @@ -208,6 +207,7 @@ protected function getOwner() { return $this->currentUser->id(); } // Anonymous users needs special handling. + // @todo Fix me. if (!isset($_SESSION['user_private_owner'])) { $_SESSION['user_private_owner'] = Crypt::randomBytesBase64(); } diff --git a/core/modules/user/src/SharedTempStoreFactory.php b/core/modules/user/src/SharedTempStoreFactory.php index 01f440b..cf069d7 100644 --- a/core/modules/user/src/SharedTempStoreFactory.php +++ b/core/modules/user/src/SharedTempStoreFactory.php @@ -89,6 +89,7 @@ function get($collection, $owner = NULL) { } else { // Anonymous users needs special handling. + // @todo Fix me. if (!isset($_SESSION['user_shared_owner'])) { $_SESSION['user_shared_owner'] = Crypt::randomBytesBase64(); } diff --git a/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php b/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php index a2d3d95..bd71c9f 100644 --- a/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php +++ b/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php @@ -10,7 +10,6 @@ use Drupal\Tests\UnitTestCase; use Drupal\user\PrivateTempStore; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; /** * @coversDefaultClass \Drupal\user\PrivateTempStore @@ -47,13 +46,6 @@ class PrivateTempStoreTest extends UnitTestCase { protected $currentUser; /** - * The request stack. - * - * @var \Symfony\Component\HttpFoundation\RequestStack - */ - protected $requestStack; - - /** * A tempstore object belonging to the owner. * * @var \stdClass @@ -80,11 +72,9 @@ protected function setUp() { ->method('id') ->willReturn(1); - $this->requestStack = new RequestStack(); $request = Request::createFromGlobals(); - $this->requestStack->push($request); - $this->tempStore = new PrivateTempStore($this->keyValue, $this->lock, $this->currentUser, $this->requestStack, 604800); + $this->tempStore = new PrivateTempStore($this->keyValue, $this->lock, $this->currentUser, 604800); $this->ownObject = (object) array( 'data' => 'test_data',