web\Session getIterator()

getIterator() public method Returns an iterator for traversing the session variables. This method is required by the interface IteratorAggregate. public yii\web\SessionIterator getIterator ( )return yii\web\SessionIterator An iterator for traversing the session variables.

web\Session getId()

getId() public method Gets the session ID. This is a wrapper for PHP session_id(). public string getId ( )return string The current session ID

web\Session getGCProbability()

getGCProbability() public method public float getGCProbability ( )return float The probability (percentage) that the GC (garbage collection) process is started on every session initialization, defaults to 1 meaning 1% chance.

web\Session getFlash()

getFlash() public method Returns a flash message. See also: setFlash() addFlash() hasFlash() getAllFlashes() removeFlash() public mixed getFlash ( $key, $defaultValue = null, $delete = false )$key string The key identifying the flash message $defaultValue mixed Value to be returned if the flash message does not exist. $delete boolean Whether to delete this flash message right after this method is called. If false, the flash message will be automatically deleted in the next request.

web\Session getHasSessionId()

getHasSessionId() public method Returns a value indicating whether the current request has sent the session ID. The default implementation will check cookie and $_GET using the session name. If you send session ID via other ways, you may need to override this method or call setHasSessionId() to explicitly set whether the session ID is sent. public boolean getHasSessionId ( )return boolean Whether the current request has sent the session ID.

web\Session getCount()

getCount() public method Returns the number of items in the session. public integer getCount ( )return integer The number of session variables

web\Session getCookieParams()

getCookieParams() public method See also http://php.net/manual/en/function.session-get-cookie-params.php. public array getCookieParams ( )return array The session cookie parameters.

web\Session getAllFlashes()

getAllFlashes() public method Returns all flash messages. You may use this method to display all the flash messages in a view file: <?php foreach (Yii::$app->session->getAllFlashes() as $key => $message) { echo '<div class="alert alert-' . $key . '">' . $message . '</div>'; } ?> With the above code you can use the bootstrap alert classes such as success, info, danger as the flash message key to influence the color of the div. Note that if you use addFlash(),

web\Session destroySession()

destroySession() public method Session destroy handler. This method should be overridden if $useCustomStorage returns true. Do not call this method directly. public boolean destroySession ( $id )$id string Session ID return boolean Whether session is destroyed successfully

web\Session get()

get() public method Returns the session variable value with the session variable name. If the session variable does not exist, the $defaultValue will be returned. public mixed get ( $key, $defaultValue = null )$key string The session variable name $defaultValue mixed The default value to be returned when the session variable does not exist. return mixed The session variable value, or $defaultValue if the session variable does not exist.