if ( is_array( $this->store->get( $key ) ) ) {
$create = false; // If loading fails, don't bother creating because it probably will fail too.
if ( $this->loadSessionInfoFromStore( $info, $request ) ) {
if ( is_array( $this->store->get( $key ) ) ) {
$create = false; // If loading fails, don't bother creating because it probably will fail too.
if ( $this->loadSessionInfoFromStore( $info, $request ) ) {
if ( is_array( $this->store->get( $key ) ) ) {
throw new \InvalidArgumentException( 'Session ID already exists' );
}
if ( is_array( $this->store->get( $key ) ) ) {
throw new \InvalidArgumentException( 'Session ID already exists' );
}
if ( $this->sessionProviders === null ) {
$this->sessionProviders = [];
foreach ( $this->config->get( 'SessionProviders' ) as $spec ) {
if ( $this->sessionProviders === null ) {
$this->sessionProviders = [];
foreach ( $this->config->get( 'SessionProviders' ) as $spec ) {
$provider->setLogger( $this->logger );
$provider->setConfig( $this->config );
$provider->setManager( $this );
$provider->setLogger( $this->logger );
$provider->setConfig( $this->config );
$provider->setManager( $this );
* @return bool Whether the session info matches the stored data (if any)
*/
private function loadSessionInfoFromStore( SessionInfo &$info, WebRequest $request ) {
* @return bool Whether the session info matches the stored data (if any)
*/
private function loadSessionInfoFromStore( SessionInfo &$info, WebRequest $request ) {
$blob = $this->store->get( $key );
// If we got data from the store and the SessionInfo says to force use,
$blob = $this->store->get( $key );
// If we got data from the store and the SessionInfo says to force use,
public function generateSessionId() {
do {
$id = \Wikimedia\base_convert( \MWCryptRand::generateHex( 40 ), 16, 32, 32 );
public function generateSessionId() {
do {
$id = \Wikimedia\base_convert( \MWCryptRand::generateHex( 40 ), 16, 32, 32 );