0

我有一个 java 代码,我正在审查它的安全漏洞。该代码是使用 Apache Struts 框架开发的。代码中未设置会话超时。据我所知,只要框架没有设置默认会话超时值,这表明存在过多的会话超时漏洞。

4

1 回答 1

0

由于您没有明确设置会话超时,您可以使用HttpSession接口getMaxInactiveInterval()的方法在 struts 中获取会话超时的值。

代码:

HttpSession session = ServletActionContext.getRequest().getSession();  
int timeout = session.getMaxInactiveInterval();//Returns the maximum time interval, in seconds
于 2017-10-30T10:51:05.920 回答