Store PHP sessions in the database

This commit is contained in:
Frédéric Guillot
2017-12-06 16:19:11 -08:00
committed by Frédéric Guillot
parent 421531bd4f
commit ccd177ada6
58 changed files with 405 additions and 382 deletions

View File

@@ -53,11 +53,11 @@ class OAuth2 extends Base
*/
public function getState()
{
if (! isset($this->sessionStorage->oauthState) || empty($this->sessionStorage->oauthState)) {
$this->sessionStorage->oauthState = $this->token->getToken();
if (! session_exists('oauthState')) {
session_set('oauthState', $this->token->getToken());
}
return $this->sessionStorage->oauthState;
return session_get('oauthState');
}
/**
@@ -140,11 +140,12 @@ class OAuth2 extends Base
* @access public
* @param string $token
* @param string $type
* @return string
* @return $this
*/
public function setAccessToken($token, $type = 'bearer')
{
$this->accessToken = $token;
$this->tokenType = $type;
return $this;
}
}