java - How to set tomcat session timeout per path? -




i know how change global session-timeout in tomcat8:

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

question: how can change timeout per application path?

like want deploy multiple applications to:

/myapp/v1 /myapp/v2 /myapp/v3 /someapp 

now want /myapp/* path have different timeout. on testserver. on production server timeout should kept default tomcat 30mins.

that's why don't want add web.xml app itself, affect production deployment when new war deployed.

is possible @ all?

if matters: i'm using spring-boot.

your best bet handle within sessionhandler class, along lines of this:

public class apphttpsessionlistener implements httpsessionlistener {      @override     public void sessioncreated(httpsessionevent event) {         event.getsession().setmaxinactiveinterval(15 * 60);      }      @override     public void sessiondestroyed(httpsessionevent event) {         // session destroyed     } } 

ref: http://www.groupkt.com/post/7ee95bbd/session-timeout-handling-in-java.htm

i wrong, i'm not sure can this!





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -