Это видео недоступно.
Сожалеем об этом.

Laravel Auth: Logout Other Devices after Login

Поделиться
HTML-код
  • Опубликовано: 14 авг 2024
  • Laravel 5.6 introduced a function Auth::logoutOtherDevices(), let's see it in action.
    - - - - -
    I'm available for freelance Laravel work, check out my Upwork profile: bit.ly/povilas-...
    - - - - -
    Our daily Laravel blog: laraveldaily.com
    Our 50+ Laravel tips in a FREE e-book: bit.ly/laravel-...
    Enroll in our online courses: bit.ly/laravel-...
    Try our QuickAdminPanel code generator: bit.ly/quickadm...
    Follow us on Twitter: bit.ly/twitter-...

Комментарии • 38

  • @mibrahim4245
    @mibrahim4245 2 года назад +1

    Hi,
    I tried this in Laravel 9 and it didn't work ... why ?
    UPDATE:
    it worked when I had to add the "AuthenticateSession" class to middleware group in kernel.php .. it was totally removed (not uncommented) , and I copied it from routemiddleware array from the same page ..
    but a question arises, how to redirect the logged out devices to some route?
    THANKS

  • @hichamissour2659
    @hichamissour2659 4 года назад +1

    Hello
    Thank you for sharing !
    I think it will be more interesting to integrate this functionality when changing the password:
    Present the user with the possibility of invalidating the other sessions.
    If we use the session table; there is the possibility to show the user the valid session (s).
    by checking for example: close other sessions.
    that said, thank you again for sharing !!!

  • @muhammadrifai4508
    @muhammadrifai4508 2 года назад

    thanks for your help..

  • @Develpoer-gu4pq
    @Develpoer-gu4pq 5 месяцев назад

    thank you for sharing but if I want to do this with lumen how I can do?

  • @narendrakumarbiswal2023
    @narendrakumarbiswal2023 4 года назад

    thnks it worked, mention that to use Illuminate\Support\Facades\Auth; in controller

  • @maulikpatel3659
    @maulikpatel3659 Год назад

    hello,
    if there is a case like OTT platform where we need to allow login in only two device, so is there a way to logout form only one device with respect to last login activity timestamp on new login request from third device?

  • @azizkhan6120
    @azizkhan6120 2 года назад

    Thanks for the video, how to do it if I have Jetstream Fortify already installed?

  • @user-di5nd6uu5q
    @user-di5nd6uu5q 6 месяцев назад

    It is possible only specific devices? except currently logged in?

  • @kailasbedarkar7197
    @kailasbedarkar7197 2 года назад

    Can you explain how laravel auto-logout is worked when an application is idle (inactive) for a certain time? where does Laravel manage the auto-logout code?

  • @rodrigoum
    @rodrigoum 3 года назад

    I have a problem with that, even not executing the method "logoutOtherDevices" sessions in other browsers are invalidated. I'm trying to give the option for my user to be able to mark a checkbox by requesting "logoutOtherDevices" when the user is changing their password.
    Another problem is that the user who lost the session in the other browser is redirected to the route named "login". Where could I change which route it should go to if the session was invalidated by "logoutOtherDevices" ?

  • @NathanBudd
    @NathanBudd 5 лет назад +2

    This is cool. Is there any way that you can get from the session that the user logged in in another browser so that the FF user knows why they've been logged out?

    • @PovilasKorop
      @PovilasKorop 5 лет назад +1

      Good question, haven't researched that deep, at least haven't seen this functionality "on the surface".

  • @alexisantoniojimenezjoaqui6776

    Hello, teacher, I have a problem, I am making a system where they ask me to log in by connecting one device at a time. So I use a session_id attribute and save the session there, when I close the session I set the session_id to null. but I have a detail when the session expires, which is approximately 60 minutes, the session_id is no longer set, how can I solve that part. because if it is not set I cannot access another device or the same device. because it is not null session_id.
    HELP!!!!

  • @AkunGame-vd7fm
    @AkunGame-vd7fm Год назад

    How to show flash / notif "you have been logout because...." when this feature work?

  • @rxxt-sh1vj
    @rxxt-sh1vj 3 года назад

    How to use the same concept in case of fortify . As in your fortify video you deleted all AUTH controllers while using laravel ui frontend .Can you please elaborate?

  • @alexrusin
    @alexrusin 5 лет назад

    Nice. I didn't know about this feature. Thank you for sharing.

  • @hemant19
    @hemant19 4 года назад +1

    Is there a way to add flash message to logout users?

  • @MsRebel411
    @MsRebel411 3 года назад

    Thanks for sharing... Unfortunately this does not work with Jetstream and livewire... Can you do a tutorial for it?!? Regards

  • @riwajchalise8317
    @riwajchalise8317 3 года назад

    What If I don't want to logout from other devices and instead show a session that says "You can't log in from multiple devices. first logout from another device" ??

  • @dropdead66672
    @dropdead66672 4 года назад

    hola, me gustaria saber como puedo utilizar el metodo despues de loguear con id de usuario

  • @PremLamsal1
    @PremLamsal1 11 месяцев назад

    How to do this with custom auth guard like admin?

  • @amirabachouche8314
    @amirabachouche8314 4 года назад

    hi, i got an issue in my projet is that i got automatically logs out users after submitting update form

  • @SaifulIslam-dn3tj
    @SaifulIslam-dn3tj 3 года назад

    Thank you for sharing !

  • @alanaprianto5059
    @alanaprianto5059 4 года назад

    how about api?
    i need this function for my app but using api middleware not web.

  • @iamrishi7
    @iamrishi7 2 года назад

    How to this in laravel Breeze?

  • @gauravruparel5991
    @gauravruparel5991 4 года назад

    Very helpful.. Thanks

  • @kapitannwel
    @kapitannwel 4 года назад

    this tutorial is amazing

  • @AmeerHamza-cy6km
    @AmeerHamza-cy6km Год назад

    how to restrict to one device ?

  • @azizkhan6120
    @azizkhan6120 2 года назад

    please make this video when jetstream is already used, I searched a lot but there is no content,
    and I'm stuck here, please help,

  • @Mohamadkhalaf
    @Mohamadkhalaf 4 года назад

    thank you for share this feature , i like it :D

  • @kake9857
    @kake9857 2 года назад

    Can I get a sample code, please?

  • @RaviDevgam
    @RaviDevgam 4 года назад

    Why I'm getting "Undefined variable: password"?

  • @CODINGISEASY
    @CODINGISEASY 5 лет назад

    I didnt know you could do this

  • @dsktech1315
    @dsktech1315 5 лет назад

    Awesome

  • @krittabunattakasem8967
    @krittabunattakasem8967 5 лет назад

    THE BEST

  • @VikramBhaskar
    @VikramBhaskar 5 лет назад

    Why has this post been removed from the laraveldaily.com website ?

    • @LaravelDaily
      @LaravelDaily  5 лет назад +1

      It was never on laraveldaily.com website, it's just a RUclips video on this channel. I don't re-post them on the blog (but maybe I should?)

    • @VikramBhaskar
      @VikramBhaskar 5 лет назад

      @@LaravelDaily I do get to see most of your recent videos as blog posts. By the way its helpful