public function createToken()
    {
        $hashProvider = HashProvider::getProvider();
        $token = $hashProvider->createHash($this->getSavedPasswordTokenData(), sha1($this->Password));

        $this->Token = $token;
        $this->TokenExpiry = date("Y-m-d H:i:s", strtotime("+2 weeks"));
        $this->save();

        return $token;
    }
public function createToken()
    {
        $hashProvider = HashProvider::getProvider();
        $token = $hashProvider->createHash($this->getSavedPasswordTokenData(), sha1($this->Password));

        $this->Token = $token;
        $this->TokenExpiry = date("Y-m-d H:i:s", strtotime("+2 weeks"));
        $this->save();

        return $token;
    }
public function createToken ( ) { $ hashProvider = HashProvider :: getProvider ( ) ; $ token = $ hashProvider -> createHash ( $ this -> getSavedPasswordTokenData ( ) , sha1 ( $ this -> Password ) ) ; $ this -> Token = $ token ; $ this -> TokenExpiry = date ( "Y-m-d H:i:s" , strtotime ( "+2 weeks" ) ) ; $ this -> save ( ) ; return $ token ; }
Creates a token for the user which allows for logging in via a cookie.

@throws Exceptions\TokenException
@return StringColumn The token.
Creates a token for the user which allows for logging in via a cookie .