6

I have an application hosted and it uses many different servlet paths. It seems Jetty (that GAE uses) creates a new session for every context path in the request URL.

Example:

  1. abc.appspot.com/

  2. abc.appspot.com/path2/hello

Each of those paths use two different sessions. Is there any way to prevent that? I came across the following config that can be used in the web.xml file for Jetty servers:

<context-param> <param-name>org.eclipse.jetty.servlet.SessionPath</param-name> <param-value>/</param-value> </context-param>

It hasn't worked for me, am I doing it wrong or this is impossible? I've heard this is possible in Tomcat.

Kumar
  • 1,023
  • 1
  • 10
  • 23

1 Answers1

0

I'm guessing you want to share a session (data) between 2 applications and not just share the same id with different id.

If so, check spring-session which is server agnostic, and can help you to do crazy stuff

wargre
  • 4,575
  • 1
  • 19
  • 35
  • I read the docs and it tells me we need to install Redis in the local system and run it on a port to enable Spring Session. I don't think that's possible in a standard Google App Engine environment. – Kumar Aug 28 '17 at 10:33
  • I think it is possible. You can also use a standard DB to store your session. There is a lot of option. – wargre Aug 28 '17 at 11:03
  • GAE is a PaaS where programmers don't have access to the file system. Could you point me to a link in GAE docs that shows how this is possible? – Kumar Aug 28 '17 at 11:19
  • 1
    You have an application without a DB / data storage ? Use the same thing for the session. – wargre Aug 28 '17 at 14:34