I’m having a really odd issue. I’m reusing a piece of code that was fully functional in a previous project but now fails. The code does something like this (code simplified to minimal failing scenario):
if (OpenID.isAuthenticationResponse()) {
UserInfo verifiedUser = OpenID.getVerifiedID();
String value = session.get(AppKeys.AUTH_METHOD); << ERROR
Application.index();
} else {
OpenID openid = getOpenId(client);
session.put(AppKeys.AUTH_METHOD, value);
if (!openid.verify()) {
Application.index();
}
}
Previously I could retrieve the value in the line marked as ERROR. Now that line sets value to null. I’ve done some tests and, somehow, the session values are lost during the requests although the session id is the same always (so the session in itself doesn’t get lost).
I’m sure there is some configuration I’ve broken, but I’m not being able to find which one. Anyone knows?
In one of those situations of “find the answer just as you sent the question” I discovered the issue. This was the setting screwing the process:
As I’m in localhost the cookie was not retrieved, and in Play the session values are stored in the cookie as Play is stateless.
Yes, it’s time to go to bed…