HttpSession

billcao 2000-02-15 08:47:00
In java servlet,I use Httpsession,but I can't control it's time,for Example,I use:
Long userID = null;
HttpSession session = req.getSession(false);
if (session == null) {
throw new Exception("no session");
} else {
userID = (Long) session.getValue("userID");
if (userID == null) {
throw new Exception("no the user");
}
}

,but sometimes in 10 minutes,session not be used,I hope after 30 minutes,it may not be used,who can help me
Thank you,Thank you,Thank you,Thank you,Thank you,Thank you!!!!!!!
...全文
138 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
skt642 2001-05-31
  • 打赏
  • 举报
回复
19444关注!
alou 2000-02-24
  • 打赏
  • 举报
回复
Can HttpSession.SetMaxInactiveInterval() help you?

62,612

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧