douyan3478 2014-12-03 08:19
浏览 17
已采纳

会话过期时,从DB清除基于会话的数据

What is the best way to check in Symfony2 if a session (not the current) by sessionID is expired.

I have a database e.g. id|sessionId|someData and I want to create a command that remove all rows which sessions are expired.

  • 写回答

1条回答 默认 最新

  • doufei9946 2014-12-03 10:26
    关注

    If you're using the default symfony session handling which relies on php-sessions you're out of luck.

    As soon as your session is expired you get a new one.

    However if you access to the session save path you might try the accepted answer in this question:

    Check if PHP session_id is in use

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

报告相同问题?

悬赏问题

  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化