Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\Framework\App\Request\Http $request, SidResolverInterface $sidResolver, ConfigInterface $sessionConfig, SaveHandlerInterface $saveHandler, ValidatorInterface $validator, StorageInterface $storage, \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager, \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory, \Magento\Framework\App\State $appState) | |
writeClose () | |
__call ($method, $args) | |
start () | |
isSessionExists () | |
getData ($key='', $clear=false) | |
getSessionId () | |
getName () | |
setName ($name) | |
destroy (array $options=null) | |
clearStorage () | |
getCookieDomain () | |
getCookiePath () | |
getCookieLifetime () | |
setSessionId ($sessionId) | |
getSessionIdForHost ($urlHost) | |
isValidForHost ($host) | |
isValidForPath ($path) | |
regenerateId () | |
expireSessionCookie () | |
Protected Member Functions | |
registerSaveHandler () | |
_addHost () | |
_getHosts () | |
_cleanHosts () | |
clearSubDomainSessionCookie () | |
Protected Attributes | |
$defaultDestroyOptions = ['send_expire_cookie' => true, 'clear_storage' => true] | |
$validator | |
$request | |
$sidResolver | |
$sessionConfig | |
$saveHandler | |
$storage | |
$cookieManager | |
$cookieMetadataFactory | |
Static Protected Attributes | |
static | $urlHostCache = [] |
Additional Inherited Members | |
![]() | |
const | HOST_KEY = '_session_hosts' |
Session Manager @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 16 of file SessionManager.php.
__construct | ( | \Magento\Framework\App\Request\Http | $request, |
SidResolverInterface | $sidResolver, | ||
ConfigInterface | $sessionConfig, | ||
SaveHandlerInterface | $saveHandler, | ||
ValidatorInterface | $validator, | ||
StorageInterface | $storage, | ||
\Magento\Framework\Stdlib\CookieManagerInterface | $cookieManager, | ||
\Magento\Framework\Stdlib\Cookie\CookieMetadataFactory | $cookieMetadataFactory, | ||
\Magento\Framework\App\State | $appState | ||
) |
\Magento\Framework\App\Request\Http | $request | |
SidResolverInterface | $sidResolver | |
ConfigInterface | $sessionConfig | |
SaveHandlerInterface | $saveHandler | |
ValidatorInterface | $validator | |
StorageInterface | $storage | |
\Magento\Framework\Stdlib\CookieManagerInterface | $cookieManager | |
\Magento\Framework\Stdlib\Cookie\CookieMetadataFactory | $cookieMetadataFactory | |
\Magento\Framework\App\State | $appState |
Definition at line 107 of file SessionManager.php.
__call | ( | $method, | |
$args | |||
) |
Storage accessor method
string | $method | |
array | $args |
Definition at line 147 of file SessionManager.php.
|
protected |
Register request host name as used with session
Definition at line 467 of file SessionManager.php.
|
protected |
Clean all host names that were registered with session
Definition at line 495 of file SessionManager.php.
|
protected |
Get all host names where session was used
Definition at line 485 of file SessionManager.php.
clearStorage | ( | ) |
Unset all session data
Implements SessionManagerInterface.
Definition at line 351 of file SessionManager.php.
|
protected |
Expire the session cookie for sub domains
Definition at line 552 of file SessionManager.php.
destroy | ( | array | $options = null | ) |
Destroy/end a session
array | $options |
Implements SessionManagerInterface.
Definition at line 326 of file SessionManager.php.
expireSessionCookie | ( | ) |
Expire the session cookie
Sends a session cookie with no value, and with an expiry in the past.
Implements SessionManagerInterface.
Definition at line 574 of file SessionManager.php.
getCookieDomain | ( | ) |
Retrieve Cookie domain
Implements SessionManagerInterface.
Definition at line 362 of file SessionManager.php.
getCookieLifetime | ( | ) |
Retrieve cookie lifetime
Implements SessionManagerInterface.
Definition at line 382 of file SessionManager.php.
getCookiePath | ( | ) |
Retrieve cookie path
Implements SessionManagerInterface.
Definition at line 372 of file SessionManager.php.
getData | ( | $key = '' , |
|
$clear = false |
|||
) |
Additional get data with clear mode
string | $key | |
bool | $clear |
Definition at line 279 of file SessionManager.php.
getName | ( | ) |
Retrieve session name
Implements SessionManagerInterface.
Definition at line 303 of file SessionManager.php.
getSessionId | ( | ) |
Retrieve session Id
Implements SessionManagerInterface.
Definition at line 293 of file SessionManager.php.
getSessionIdForHost | ( | $urlHost | ) |
If session cookie is not applicable due to host or path mismatch - add session id to query
string | $urlHost | can be host or url |
Implements SessionManagerInterface.
Definition at line 409 of file SessionManager.php.
isSessionExists | ( | ) |
Does a session exist
Implements SessionManagerInterface.
Definition at line 264 of file SessionManager.php.
isValidForHost | ( | $host | ) |
Check if session is valid for given hostname
string | $host |
Implements SessionManagerInterface.
Definition at line 438 of file SessionManager.php.
isValidForPath | ( | $path | ) |
Check if session is valid for given path
string | $path |
Implements SessionManagerInterface.
Definition at line 451 of file SessionManager.php.
regenerateId | ( | ) |
Renew session id and update session cookie
Implements SessionManagerInterface.
Definition at line 506 of file SessionManager.php.
|
protected |
Register save handler
Definition at line 247 of file SessionManager.php.
setName | ( | $name | ) |
Set session name
string | $name |
Implements SessionManagerInterface.
Definition at line 314 of file SessionManager.php.
setSessionId | ( | $sessionId | ) |
Specify session identifier
string | null | $sessionId |
Implements SessionManagerInterface.
Definition at line 393 of file SessionManager.php.
start | ( | ) |
Configure session handler and start session
Implements SessionManagerInterface.
Definition at line 164 of file SessionManager.php.
writeClose | ( | ) |
This method needs to support sessions with APC enabled
Implements SessionManagerInterface.
Definition at line 134 of file SessionManager.php.
|
protected |
Definition at line 83 of file SessionManager.php.
|
protected |
Definition at line 88 of file SessionManager.php.
|
protected |
Definition at line 27 of file SessionManager.php.
|
protected |
Definition at line 48 of file SessionManager.php.
|
protected |
Definition at line 69 of file SessionManager.php.
|
protected |
Definition at line 62 of file SessionManager.php.
|
protected |
Definition at line 55 of file SessionManager.php.
|
protected |
Definition at line 76 of file SessionManager.php.
|
staticprotected |
Definition at line 34 of file SessionManager.php.
|
protected |
Definition at line 41 of file SessionManager.php.