Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Commit

Permalink
bug fix, SessionFactory do not use toArray@Session, use getRawParams
Browse files Browse the repository at this point in the history
  • Loading branch information
Changwan Jun committed Mar 11, 2016
1 parent 4d56856 commit 55b75e6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Contracts/SessionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public function set($name, $value);
*/
public function flash($name, $value);

/**
* @return array
*/
public function getRawParams();

/**
* @param string $name
* @return self
Expand Down
11 changes: 11 additions & 0 deletions src/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public function getId()
return $this->id;
}

/**
* @return array
*/
public function toArray()
{
$arrayToReturn = parent::toArray();
Expand All @@ -40,6 +43,14 @@ public function toArray()
return $arrayToReturn;
}

/**
* @return array
*/
public function getRawParams()
{
return $this->params;
}

/**
* {@inheritdoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Session/SessionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function fromCookieJar(CookieJarInterface $cookieJar)
public function toCookieJar(SessionInterface $session, CookieJarInterface $cookieJar)
{
$sessionName = $this->config['name'];
$this->adapter->write($session->getId(), $session->toArray());
$this->adapter->write($session->getId(), $session->getRawParams());
if (!$cookieJar->has($sessionName)) {
$sessionId = $this->generateId();
} else {
Expand Down

0 comments on commit 55b75e6

Please sign in to comment.