>  Q&A  >  본문

java - 用HttpSession的setMaxInterval(-1)设置会话永不超时意味着什么?应用场景有哪些?

【问题背景】在servletAPI中,对HttpSession的方法seMaxInterval有这样一句说明:A zero or negative time indicates that the session should never timeout.
【分析与问题】我们知道cookie是保存在客户端的,默认和会话寿命一样,但可以设置会话结束后还存活,即存入客户本地储存。而session是在服务端的,session永不到期意味着什么?存入服务端储存?还是以对象一直驻留,直到应用程序关闭?设置会话永不过期的应用场景有哪些?

阿神阿神2717일 전570

모든 응답(0)나는 대답할 것이다

답장 없음
  • 취소회신하다