This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

unique session for every tabs of browser window

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a application that have a functionality to login and insert some data. i am using session but if user copy and paste the url in other tab than i want to redirect user to login page. can you advice me to what to do for it. only flow will also work it for me.

thanks

prashant
 
Ranch Hand
Posts: 356
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would be a browser feature. The servlet doesn't handle that.

Depending on the browser you are using, it can be configured or in some cases to download a plug-in to achieve that behavior.
(I meant for IE, FF, Chrome)
 
Prashant Chindhade
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it does not depend on browser after this post i have tried and i have achieved that...
by the way thanks for your reply..

regs

Prashant
 
German Gonzalez-Morris
Ranch Hand
Posts: 356
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so how did you achieve it ?

for instance, for FF each new tab stays in the same session, we can do a simple test case to replicate that.
 
Prashant Chindhade
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have achieved it by the way of cookies
first store cookies values like name and session id as null when application first starts ...

than create and save value to that cookies when use logged in

than on login page write some code for authentication that if same session id from cookie than redirect to login page. the session.getSession(true); will get new session

and i am using servlet so if i copy and paste it on other tab than the parameters from login jsp will be null so it will redirected to login page....thats how..i have done it


regs

Prashant
 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if cookies are disabled and what if each tab, uses a different sessionid (not sure, if any browser does that, but what if). I still think and read some where that it is a browser dependent.
 
Prashant Chindhade
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its not browser dependent man you go to any banking web site and login than copy url and paste it ...you will got error. it is possible in every browser .....

and if cookies are disabled than it should be enabled by our application....
regs
Prashant Chindhade
 
Marshal
Posts: 67414
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your application cannot enable cookies if they are disabled.
 
    Bookmark Topic Watch Topic
  • New Topic