Request::hasSession PHP Méthode

hasSession() public static méthode

This method does not give any information about the state of the session object, like whether the session is started or not. It is just a way to check if this Request is associated with a Session instance.
public static hasSession ( ) : boolean
Résultat boolean true when the Request contains a Session object, false otherwise
        public static function hasSession()
        {
            //Method inherited from \Symfony\Component\HttpFoundation\Request
            return \Illuminate\Http\Request::hasSession();
        }

Usage Example

Exemple #1
0
 function getValue()
 {
     if ($this->useOldValue && \Request::hasSession()) {
         return old($this->name, $this->value);
     } else {
         return $this->value;
     }
 }