• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 9
Postgres Database Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Postgres Database Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic