dongwo5686 2016-11-21 04:47
浏览 61
已采纳

在laravel 5.3中删除登录时的旧会话

How can I remove all expired user sessions from DB on login event ? I delete user session after log out. But sometimes a log out button not clicked and session expires and stay in DB.

I need delete all sessions from any machines for current user on user login event.

It possible or not in laravel 5.3?

  • 写回答

1条回答 默认 最新

  • doumi1944 2016-11-21 05:00
    关注

    Yes. It is possible.

    1. Before User login, check for any existing sessions in database for same user. One architectural assumption here, all existing sessions should be expired and need to be deleted.
    2. If any exists, delete them.
    3. Make sure you create/insert entry for current login after you delete existing/expired sessions.

    For more information, you can check this question and relevant answers.

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

报告相同问题?

悬赏问题

  • ¥15 商城生产日期批次库存问题
  • ¥15 esp8266控制共阳极wrgb灯板无法关闭所有led灯
  • ¥100 python读取速度问题
  • ¥15 stm32f407使用DMA问题
  • ¥15 您好 这个API接口该怎么弄 网站搭建好了 API也有 现在就不知道该怎么填写API 不知道怎么用
  • ¥88 用uniapp写一个多端的程序,用到高德地图,用高德的JSAPI吗?
  • ¥20 关于#c++#的问题:水果店管理系统
  • ¥30 dbLinq最新版linq sqlite
  • ¥20 对D盘进行分盘之前没有将visual studio2022卸载掉,现在该如何下载回来
  • ¥15 完成虚拟机环境配置,还有安装kettle