Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Same browser logged as different users from using different tabs the first user not logged out  RSS feed

 
Santhosh Samban
Greenhorn
Posts: 9
Java Postgres Database Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using jsp for view pages and servlet for setting resetting sessions

I am developing an application that needs to logged out when using different tabs just like Gmail

The Scenario is like this

let us assume we have user1 and user2

step1: I have logged in as user1 in a browser

step2: I take new tab in the same browser and log in as user2. At this moment I want user1 to be logged off automatically from tab1.

In current scenario the first tab automatically replaces user1 with user2.

I need it like Gmail when I login as different user from new tab then the first tab automatically get logged out with a message.

Please advice me how to do this?
 
Dave Tolls
Rancher
Posts: 2914
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure how GMail does it, but I'm guessing some sort of GUID is generated on logging in.
The browser page (not cookie) holds the GUID and sends it along with any future request.
GUI mismatch means logged out.
 
Santhosh Samban
Greenhorn
Posts: 9
Java Postgres Database Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you mean I need to create GUID(Which will be universally unique id) on each login and save in session? Sounds like a good idea. Can you elaborate buddy?
 
Dave Tolls
Rancher
Posts: 2914
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Santhosh Samban wrote:So you mean I need to create GUID(Which will be universally unique id) on each login and save in session? Sounds like a good idea. Can you elaborate buddy?


You also need it on the page so it can be attached to any requests made from the page (in GMail's case when it checks for any new emails).
Then your server checks if the GUIDs match.

That should be plenty to be going on with.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!