doupa9062 2018-04-11 21:29
浏览 168
已采纳

我如何解决Deprecated:非静态方法Session :: get()不应在第13行的C:\ xampp \ htdocs \ ooplr \ classes \ token.php中静态调用[复制]

This code generates hashed password

class Token {
    public static function generate()
    {
        return Session::put(Config::get('session/token_name'), md5(uniqid()));
    }

    public static function check($token)
    {
        $tokenName = Config::get('session/token_name');

        if (Session::exists($tokenName) && $token === Session::get($tokenName)) 
        {
            return true;
        }

        return false;
    }
}

But then I can't debug this program , please what's wrong it. thanks in ADVANCE

</div>
  • 写回答

1条回答 默认 最新

  • douwei1174 2018-04-11 22:48
    关注

    You need to change your Session class get function declaration.

    From:

    function get()

    to:

    public static function get()

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?