public function testSetName()
 {
     $this->assertEquals('MOCKSESSID', $this->session->getName());
     $this->session->setName('session.test.com');
     $this->session->start();
     $this->assertEquals('session.test.com', $this->session->getName());
 }
Exemple #2
0
 protected function appendRealmToName(Request $request)
 {
     if (!$this->options->getBoolean('restrict_realm')) {
         return;
     }
     $name = $this->session->getName();
     $realm = '_' . md5($request->getHttpHost() . $request->getBaseUrl());
     if (substr($name, -strlen($realm)) === $realm) {
         // name ends with realm
         return;
     }
     $this->session->setName($name . $realm);
 }
Exemple #3
0
 /**
  * Set the session ID from request cookies
  *
  * @param GetResponseEvent $event
  */
 public function onRequest(GetResponseEvent $event)
 {
     if (!$event->isMasterRequest()) {
         return;
     }
     $request = $event->getRequest();
     $request->setSession($this->session);
     $name = $this->session->getName();
     if ($this->options->getBoolean('restrict_realm')) {
         $name .= md5($request->getHttpHost() . $request->getBaseUrl());
         $this->session->setName($name);
     }
     if ($request->cookies->has($name)) {
         $this->session->setId($request->cookies->get($name));
         $this->session->start();
     }
 }
Exemple #4
0
 /**
  * Set the session name
  *
  * @param string $name Session name
  * @return void
  * @since 1.9
  */
 public function setName($name)
 {
     $this->storage->setName($name);
 }