小程序已经正式上线,但是一直有个问题困扰着我。请处理过这类问题的前辈能不吝赐教
问题描述:
我是负责前端开发的,由于某些需求变动,后台(java)需要频繁的修改,修改完之后后台负责把代码部署上线。据后台开发说,后台部署代码到服务器后需要重启tomcat,重启后会导致给前端分发的session失效。如果此时用户正在访问某个页面,而前端把失效的 session 通过接口发送给后台,就会导致数据请求失败,非常影响用户体验。
不知道大家都是怎么处理这类问题的,想请教下大家的处理方式
大家都是如何处理后台 tomcat 重启导致session失效,接口请求不成功需要重新登录的问题的?How do you deal with the problem of session failure due to tomcat restart in the background, and re-login required for unsuccessful interface requests?
大家都是如何处理后台 tomcat 重启导致session失效,接口请求不成功需要重新登录的问题的?小程序已经正式上线,但是一直有个问题困扰着我。请处理过这类问题的前辈能不吝赐教
问题描述:
我是负责前端开发的,由于某些需求变动,后台(java)需要频繁的修改,修改完之后后台负责把代码部署上线。据后台开发说,后台部署代码到服务器后需要重启tomcat,重启后会导致给前端分发的session失效。如果此时用户正在访问某个页面,而前端把失效的 session 通过接口发送给后台,就会导致数据请求失败,非常影响用户体验。
不知道大家都是怎么处理这类问题的,想请教下大家的处理方式
Small program has been officially launched, but there has been a problem bothering me. I am responsible for the front-end development. Due to some requirements changes, the background (Java) needs to be modified frequently. After modification, the background is responsible for deploying the code online. According to the background development, Tomcat needs to be restarted after the background code is deployed to the server, which will lead to the failure of the session distributed to the front end. If the user is visiting a page at this time, and the front end sends the invalid session to the background through the interface, the data request will fail, which greatly affects the user experience. I don't know how we all deal with this kind of problem. I would like to ask you how to deal with it
回答:
修改tomcat的配置文件"conf/context.xml" ,去掉<Manager pathname="" />和<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />的注释,然后删除work文件夹,再重启服务器的时候,就会不保留session
问你们负责人