Reputation: 537
I've an gae application (java, gae 1.9.14, guice 3.0) that makes use of the module pattern. Each module serves a single page application (html & js). One module authenticates the user (email/pwd) and then redirects to another module. The problem that I'm facing is that each time I initially access a different module a new session gets created.
Is there actually a way to share session data across modules? If not, how would I implement such a simple use case?
Thanks in advance!
Upvotes: 1
Views: 171
Reputation: 537
I'm now generating an authentication token that I store in the DB with the account and pass it to the client on login. the client uses this token to authentication again in the other module (stores it in local storage). after successful authentication in the module the token gets destroyed.
Upvotes: 0
Reputation: 1235
When the user is authenticated store the user detail's in new entity like session , details are like user ip address, browser detail's and user email id.
On every module write filter{on initial req} and get the user email based on the req ip address, browser detail's from the new created entity session, update the new httpsession.
remove the record from the entity when the user logout from the application
Upvotes: 0