简体   繁体   中英

Difference between Auth::logout() and Session::flush()

For some reasons, i cannot use Auth . So, instead Auth::logout() i'm using Session::flush() .

My session driver is database .

I have two questions:

  1. What's the difference, internally , between these methods ( Auth::logout() and Session::flush() )?

  2. There is some risk for me when using Session::push() for login and Session::flush() for logout users?

Taken from laravel documentation:

Removing All Items From The Session Session::flush()

So, if you use session::flush and have data in your session it will be deleted.

Why you cannot use Auth::logout()? How did you login the user then?

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