public static function create(string $name, int $lifetime = 300): string
    {
        $token = sha1(microtime());
        $tokenData = [
            'token' => $token,
            'time' => time(),
            'lifetime' => $lifetime
        ];
        Session::set($name, $tokenData, self::$namespace);
        return $token;
    }
public static function create(string $name, int $lifetime = 300): string
    {
        $token = sha1(microtime());
        $tokenData = [
            'token' => $token,
            'time' => time(),
            'lifetime' => $lifetime
        ];
        Session::set($name, $tokenData, self::$namespace);
        return $token;
    }
public static function create ( string $ name , int $ lifetime = 300 ) : string { $ token = sha1 ( microtime ( ) ) ; $ tokenData = [ 'token' => $ token , 'time' => time ( ) , 'lifetime' => $ lifetime ] ; Session :: set ( $ name , $ tokenData , self :: $ namespace ) ; return $ token ; }
Create token.

@param string $name
@param int $lifetime Default 300 seconds.
@return string
Create token .