protected function makeState()
    {
        if (!$this->request->hasSession()) {
            return false;
        }

        $state = sha1(uniqid(mt_rand(1, 1000000), true));
        $session = $this->request->getSession();

        if (is_callable([$session, 'put'])) {
            $session->put('state', $state);
        } elseif (is_callable([$session, 'set'])) {
            $session->set('state', $state);
        } else {
            return false;
        }

        return $state;
    }
protected function makeState()
    {
        if (!$this->request->hasSession()) {
            return false;
        }

        $state = sha1(uniqid(mt_rand(1, 1000000), true));
        $session = $this->request->getSession();

        if (is_callable([$session, 'put'])) {
            $session->put('state', $state);
        } elseif (is_callable([$session, 'set'])) {
            $session->set('state', $state);
        } else {
            return false;
        }

        return $state;
    }
protected function makeState ( ) { if ( ! $ this -> request -> hasSession ( ) ) { return false ; } $ state = sha1 ( uniqid ( mt_rand ( 1 , 1000000 ) , true ) ) ; $ session = $ this -> request -> getSession ( ) ; if ( is_callable ( [ $ session , 'put' ] ) ) { $ session -> put ( 'state' , $ state ) ; } elseif ( is_callable ( [ $ session , 'set' ] ) ) { $ session -> set ( 'state' , $ state ) ; } else { return false ; } return $ state ; }
Put state to session storage and return it.

@return string|bool
Put state to session storage and return it .