src/Http/Cookie/Drivers/CookieDriver.php
/**
	 * Loads the current session data into the driver.
	 */
Loads the current session data into the driver.
Loads the current session data into the driver .
private function load() {
		if (!isset($_SESSION[$this->token])) {
			$this->createDefaultSession();
		}
		else {
			$sessionIsEncrypted = $_SESSION[$this->token . '_encrypted'];
			if ($sessionIsEncrypted == true && !$this->isEncryptionEnabled()) {
				$this->rewriteDisableEncryption();
			}
			elseif ($sessionIsEncrypted == false && $this->isEncryptionEnabled()) {
				$this->rewriteEnableEncryption();
			}
		}
		try {
			foreach ($_SESSION[$this->token . '_flash'] as $key => $value) {
				$this->currentFlashData[$key] = $this->unserialize($this->decrypt($value));
				$this->sessionData[$key] = $this->currentFlashData[$key];
			}
			foreach ($_SESSION[$this->token] as $key => $value) {
				$this->sessionData[$key] = $this->unserialize($this->decrypt($value));
			}
		}
		catch (CookieInitializationException $ex) {
			$this->clear();
		}
		$this->expireFlash();
	}
private function load ( ) { if ( ! isset ( $ _SESSION [ $ this -> token ] ) ) { $ this -> createDefaultSession ( ) ; } else { $ sessionIsEncrypted = $ _SESSION [ $ this -> token . '_encrypted' ] ; if ( $ sessionIsEncrypted == true && ! $ this -> isEncryptionEnabled ( ) ) { $ this -> rewriteDisableEncryption ( ) ; } elseif ( $ sessionIsEncrypted == false && $ this -> isEncryptionEnabled ( ) ) { $ this -> rewriteEnableEncryption ( ) ; } } try { foreach ( $ _SESSION [ $ this -> token . '_flash' ] as $ key => $ value ) { $ this -> currentFlashData [ $ key ] = $ this -> unserialize ( $ this -> decrypt ( $ value ) ) ; $ this -> sessionData [ $ key ] = $ this -> currentFlashData [ $ key ] ; } foreach ( $ _SESSION [ $ this -> token ] as $ key => $ value ) { $ this -> sessionData [ $ key ] = $ this -> unserialize ( $ this -> decrypt ( $ value ) ) ; } } catch ( CookieInitializationException $ ex ) { $ this -> clear ( ) ; } $ this -> expireFlash ( ) ; }
Loads the current session data into the driver.
Loads the current session data into the driver .
// Create a default empty payload under our token if needed // Handle cases where encryption was disabled // Load flash data // Load variables into the payload // When we fail to parse data, clear the entire session // Expire flash data