src/models/User.php
public function getAndStoreToken()
    {
        $token = $this->generateToken(6);
        
        $this->setAttribute('secure_token', sha1($token));
        $this->setAttribute('secure_token_timestamp', time());
        $this->update(false);

        return $token;
    }
public function getAndStoreToken()
    {
        $token = $this->generateToken(6);
        
        $this->setAttribute('secure_token', sha1($token));
        $this->setAttribute('secure_token_timestamp', time());
        $this->update(false);

        return $token;
    }
public function getAndStoreToken ( ) { $ token = $ this -> generateToken ( 6 ) ; $ this -> setAttribute ( 'secure_token' , sha1 ( $ token ) ) ; $ this -> setAttribute ( 'secure_token_timestamp' , time ( ) ) ; $ this -> update ( false ) ; return $ token ; }
Generate, store and return the secure Login token.

@return string
Generate store and return the secure Login token .