简体   繁体   中英

How to check if user is authenticated by cookie session on Laravel?

Well, at the moment I have 2 sites.

  • One with laravel (Database Session driver).
  • Another with regular php.

The two sites are in the same domain, so we can share cookies. But I need a simple way to check if the cookie session is really authenticated on the laravel site.

My idea is expose a method over the laravel site to call it from the other php project, something like this:

public function checkUser($cookie)
{
    return Auth::check($cookie);
}

There is a simple method like Auth::check($cookie) ? or what I need to accomplish this?

Thanks!

Auth::user()将返回登录用户或FALSE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM