简体   繁体   English

会话超时自动

[英]session timeout automatic

I understand that the session timeout is for finding out an idle app and ending that particular session. 我知道会话超时是为了查找一个空闲的应用程序并结束该特定会话。
I have commented the session-timeout tag in the web.xml. 我在web.xml中注释了session-timeout标记。 Also I have not set any session timeout in my application anywhere else like maxInactiveInterval(). 此外,我没有在我的应用程序中设置任何会话超时,如maxInactiveInterval()。

But my session is expiring nearly after 2 or 3 hours. 但我的会议几乎在2或3个小时后到期。 Is there any automatic session timeout in Tomcat? Tomcat中是否有自动会话超时?
I have observed the above phenomenon in both Tomcat 5 & 7. Please help... I don't want a timeout happening for some purpose here. 我已经在Tomcat 5和7中观察到了上述现象。请帮助......我不希望在这里出于某种目的发生超时。

yes.In tomcat web.xml file see this code: 是。在tomcat web.xml文件中看到这段代码:

<session-config>
        <session-timeout>30</session-timeout>
    </session-config>

By default it set to 30 minutes. 默认设置为30分钟。 if you dont want session expiry simply put as 0 instead of 30. 如果你不想要会话到期,只需将其设为0而不是30。

session statics in tomcat. tomcat中的会话静态。

If you don't want a timeout happening for some purpose: 如果您不希望出于某种目的发生超时:

<session-config>
    <session-timeout>0</session-timeout>
</session-config>

should result in no timeout at all -> infinite 应该导致根本没有超时 - >无限

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM