0

The variables are not stored on a session when the project is Deployed to Google App Engine with Java. I use the common system that implements ServletRequestAware (works on local and on the current non-google server):

Map<String, Object> session = ActionContext.getContext().getSession();
        session.put(SESSION_LOGIN, true);
        session.put(SESSION_LOGIN_DATE, new Date());
        session.put(SESSION_LOGIN_ID, idCustomer);

I know those variables are not stored because i'm printing them on the logs.

I'm using new app.yaml configuration on a Flexible environment.

I've read somewhere that GAE doesn't accept "usual" sessions, instead it uses it's own, but I don't find specific documentation about that.

I'm a bit confused while searching for help, with outdated / not about the same problem / unclear (at least to me) questions and help, like those:

Anybody can point me to the right way to do it? It has to be done with a specific Google library?

  • https://stackoverflow.com/q/20761757/573032 – Roman C Mar 26 '20 at 21:12
  • Hi @RomanC, thanks for the redirection. I wasn't using Freemarker, so I don't guess this is the reason. Anyway I've included the reference on the pom.xml because it was somehow on the [struts.properties by default](https://struts.apache.org/core-developers/default-properties.html). It's still not working. I'm worried all the related questions to this issue are really old, and none of them using the new app.yaml Flexible configuration, so I guess I'm really lost and I'm missing something. – Oriol Manyà Pau Mar 27 '20 at 22:05
  • Have you tried setting the session_affinity parameter to true? This is set up under the network parameter of the app.yaml. [Reference](https://cloud.google.com/appengine/docs/flexible/java/reference/app-yaml#network_settings) – Jose V Mar 31 '20 at 10:26

0 Answers0