class OAuthSession

This class holds all the variables stored during a session

Properties

private string $id The serial number of the session used especially for database storage
private string $sessionId The id of the session
private string $state The state parameter of authorization flow
private string $nonce The value used to mitigate replay attacks
private AccessToken $accessToken The access token received from the provider
private string $provider The name of the provider
private string $creation The creation date of the session in '%Y-%m-%d %H:%M:%S' format
private string $userId The user ID of the resource owner at the provider

Methods

__construct($oauthSession = [])

Constructs a OAuthSession object from an array of session values

string
getId()

Returns the serial number of the session

string
getSessionId()

Returns the id of the session

string
getState()

Returns the state parameter of authorization flow

string
getNonce()

Returns the nonce used to mitigate replay attacks

getAccessToken()

Returns the access token received from the provider

string
getProvider()

Returns the name of the provider

string
getCreation()

Returns the creation date of the session in '%Y-%m-%d %H:%M:%S' format

string
getUserId()

Returns the user ID of the resource owner

setId(string $id)

Sets the serial number of the session

setSession(string $sessionId)

Sets the the id of the session

setState(string $state)

Sets the state parameter of authorization flow

setNonce(string $nonce)

Sets the nonce used to mitigate replay attacks

setAccessToken(AccessToken $accessToken)

Sets the access token received from the provider

setProvider(string $provider)

Sets the the name of the provider

setCreation(string $creation)

Sets the creation date of the session in '%Y-%m-%d %H:%M:%S' format

setUserId(string $userId)

Sets the user ID of the resource owner

array
toArray()

Converts the OAuthSession object to array

Details

at line 74
__construct($oauthSession = [])

Constructs a OAuthSession object from an array of session values

Parameters

$oauthSession

at line 106
string getId()

Returns the serial number of the session

Return Value

string the serial number of the session

at line 115
string getSessionId()

Returns the id of the session

Return Value

string the id of the session

at line 124
string getState()

Returns the state parameter of authorization flow

Return Value

string the state parameter

at line 133
string getNonce()

Returns the nonce used to mitigate replay attacks

Return Value

string the nonce

at line 142
AccessToken getAccessToken()

Returns the access token received from the provider

Return Value

AccessToken the access token

at line 151
string getProvider()

Returns the name of the provider

Return Value

string the name of the provider

at line 160
string getCreation()

Returns the creation date of the session in '%Y-%m-%d %H:%M:%S' format

Return Value

string the creation date of the session

at line 169
string getUserId()

Returns the user ID of the resource owner

Return Value

string the user ID

at line 180
OAuthSession setId(string $id)

Sets the serial number of the session

Parameters

string $id the serial number of the session

Return Value

OAuthSession

at line 192
OAuthSession setSession(string $sessionId)

Sets the the id of the session

Parameters

string $sessionId the id of the session

Return Value

OAuthSession

at line 204
OAuthSession setState(string $state)

Sets the state parameter of authorization flow

Parameters

string $state the state parameter

Return Value

OAuthSession

at line 216
OAuthSession setNonce(string $nonce)

Sets the nonce used to mitigate replay attacks

Parameters

string $nonce the nonce

Return Value

OAuthSession

at line 228
OAuthSession setAccessToken(AccessToken $accessToken)

Sets the access token received from the provider

Parameters

AccessToken $accessToken the access token

Return Value

OAuthSession

at line 240
OAuthSession setProvider(string $provider)

Sets the the name of the provider

Parameters

string $provider the name of the provider

Return Value

OAuthSession

at line 252
OAuthSession setCreation(string $creation)

Sets the creation date of the session in '%Y-%m-%d %H:%M:%S' format

Parameters

string $creation the creation date of the session

Return Value

OAuthSession

at line 264
OAuthSession setUserId(string $userId)

Sets the user ID of the resource owner

Parameters

string $userId the user ID

Return Value

OAuthSession

at line 274
array toArray()

Converts the OAuthSession object to array

Return Value

array of session values