search

Home  >  Q&A  >  body text

java - The default expiration time of a session is 30 minutes. Does it mean 30 minutes from the creation of the session, or 30 minutes from the last time the session was accessed?

What about that one? have no idea

给我你的怀抱给我你的怀抱2784 days ago597

reply all(3)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-17 10:09:34

    After the last visit, it will become invalid if not visited for 30 minutes.

    If it is the first situation, then the user will lose the login status while using it and have to log in again. This experience is too bad.

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-17 10:09:34

    Session created for 30 minutes means it will expire if the user does not operate it for more than 30 minutes. It will expire if the user does not have any interaction with the server. It will not expire if the user has been operating. That is, the time since the last access to the session.

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-17 10:09:34

    The principles of sessions in different languages ​​​​should be similar.
    Take PHP as an example, the main thing is to distinguish 会话cookie的过期时间会话文件的过期时间:
    1. The expiration time of the session cookie (session.cookie_lifetime), 0 means that the session cookie will expire when the browser is closed.
    2 .The reference point of the expiration time of the session file (session.gc_maxlifetime) is the last update time of the session file (update_time), not the creation time (create_time).

    reply
    0
  • Cancelreply