weblogic有session检查时间间隔这种设置吗

weblogic有session检查时间间隔这种设置吗,第1张

1 web.xml

设置web应用程序描述符web.xml里的<session-timeout>元素。这个值以分钟为

单位,并覆盖weblogic.xml中的timeoutsecs属性

<session-config>

<session-timeout>24</session-timeout>

</session-config>

此例表示session将在24分钟后过期

当<session-timeout>设置为-2,表示将使用在weblogic.xml中设置的

timeoutsecs这个属性值。

当<session-timeout>设置为-1,表示session将永不过期,而忽略在

weblogic.xml中设置的timeoutsecs属性值。

该属性值可以通过console控制台来设置

2 weblogic.xml

设置weblogic特有部署描述符weblogic.xml的<session-descriptor>元素的

timeoutsecs属性。这个值以秒为单位

<session-descriptor>

<session-param>

<param-name>timeoutsecs</param-name>

<param-value>2600</param-value>

</session-param>

</session-descriptor>

默认值是2600秒

3,jsp中控制

session.setmaxinactiveinterval(7200)

session是默认对象,可以直接引用,单位秒s

4,servlet中控制

httpsession session = request.getsession()

session.setmaxinactiveinterval(7200)

单位秒s

超时设置可通过session的[get|set]MaxInactiveInterval方法实现。如:

session.setMaxInactiveInterval(600)

就是设定session的有效期为10分钟。

我知道session是存在在服务器的由私人所有的,cookie是存在客户端的由私人所有的,servletcontext是存在服务器端集体共享的。不明白会出现什么问题。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/11300001.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-15
下一篇 2023-05-15

发表评论

登录后才能评论

评论列表(0条)

保存