java http get session超时

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java http get session超时相关的知识,希望对你有一定的参考价值。

POST /specsstore/controller?event=SEARCH_RESULTS HTTP/1.1
Cookie: language_code=CHIN; anguage_name=Chinese; currency_code=USD; currency_name=United+States+Dollars;

country_name=United+States; JSESSIONID=ExVAfHAgnUhD+G8fmiunRQ**.app22; s_cc=true; s_vnum=1271809972593%26vn%3D1;

s_invisit=true;s_lastvisit=1269217972609; s_nr=1269218538875;s_sq=ihsrollup%2Cihsstore%3D%2526pid%253Dstore%25253AIHS%

252520Standards%252520Store%252520-%252520%2525u641C%2525u5BFB%2525u53D1%2525u751F%2526pidt%253D1%2526oid%253Dhttp%

25253A//store.ihs.com/WebAppsCommon/images/china-go.gif%2526ot%253DIMAGE%2526oi%253D50; s_vi=[CS]v1|25D35D5C85011CF8-

6000010B800AF527[CE]
User-Agent: Mozilla/4.7 [en] (Win98; I)
Host: store.ihs.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-type: application/x-www-form-urlencoded
Content-Length: 16

search_value=112

--------------------------
GET /specsstore/controller?event=DOCUMENT_DETAILS&docId=GJIOPCAAAAAAAAAA HTTP/1.1
Cookie: language_code=CHIN; language_name=Chinese; currency_code=USD; currency_name=United+States+Dollars;

country_name=United+States; s_cc=true;s_sq=ihsrollup%2Cihsstore%3D%2526pid%253Dstore%25253AIHS%252520Standards%252520Store%

252520-%252520%2525u641C%2525u5BFB%2525u53D1%2525u751F%2526pidt%253D1%2526oid%253Dhttp%

25253A//store.ihs.com/specsstore/controller%25253Fevent%25253DDOCUMENT_DETAILS%252526docId%25253DGJIOPCAAAAAAAAAA%2526ot%

253DA%2526oi%253D424; s_vnum=1271809972593%26vn%3D7; s_lastvisit=1269245332359; s_nr=1269218543875; s_vi=[CS]

v1|25D35D5C85011CF8-6000010B800AF527[CE]; s_invisit=true; JSESSIONID=iNZhTuycboVmapbg9kfBGA**.app12
User-Agent: Java/1.6.0_13
Host: store.ihs.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
--------------------------------
GET /specsstore/controller?event=HISTORY_REFERENCED&docId=GJIOPCAAAAAAAAAA HTTP/1.1
Cookie: language_code=CHIN; language_name=Chinese; currency_code=USD; currency_name=United+States+Dollars;

country_name=United+States; s_cc=true;s_sq=ihsrollup%2Cihsstore%3D%2526pid%253Dstore%25253AIHS%252520Standards%252520Store%

252520-%252520%2525u641C%2525u5BFB%2525u53D1%2525u751F%2526pidt%253D1%2526oid%253Dhttp%

25253A//store.ihs.com/specsstore/controller%25253Fevent%25253DDOCUMENT_DETAILS%252526docId%25253DGJIOPCAAAAAAAAAA%2526ot%

253DA%2526oi%253D424; s_vnum=1271809972593%26vn%3D7; s_lastvisit=1269245332359; s_nr=1269218543875; s_vi=[CS]

v1|25D35D5C85011CF8-6000010B800AF527[CE]; s_invisit=true; JSESSIONID=iNZhTuycboVmapbg9kfBGA**.app12
User-Agent: Java/1.6.0_13
Host: store.ihs.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

第三次请求的时候不能获得正常结果
没有登录 只是提交信息 获得内容
请达人教下如何解决会话超时问题

参考技术A open session in view

应该建个session工厂吧,单一得session很容易死掉的。或者在配置文件中以

监听器的方式每次都打开一个
参考技术B HttpSession session = request.getSession();
session.setMaxInactiveInterval(-1);//永不超时
session.setAttribute("name",xx);本回答被提问者采纳

Java 设置session时间超时,一直没有效果,具体该怎么操作

在web.xml和tomcat中配置了都不行

<session-config>
web.xml中这么配置:
session-config包含一个子元素session-timeout.定义web站台中的session参数.
<session-timeout>分钟</session-timeout>
定义这个web站台所有session的有效期限.单位为分钟.
</session-config>
范例:
<session-config>
<session-timeout>20</session-timeout>
</session-config>

如果你都配置了还是不起作用,就直接在使用session时就设置有效时间
参考技术A 在web.xml中配置了就可以的。 假如你设置的是5分钟,那么在这5分钟内不能去访问服务器。如果访问了的话,就不会失效的。没有访问的话,超过你设置的时间(5分钟),就会失效追问

可是我设置了1分钟,过了三分钟之后还是可以进行操作

参考技术B 在时间内不能在此访问服务器

以上是关于java http get session超时的主要内容,如果未能解决你的问题,请参考以下文章

Java 设置session时间超时,一直没有效果,具体该怎么操作

Java设置session超时(失效)的时间

hbase session超时时间是多少

Java设置session超时(失效)的三种方式 设置session的有效时间

Java设置session超时(失效)的三种方式

Java设置session超时(失效)的三种方式