This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Test for Session

 
Surest Uncle
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I test for Session either open or closed using javaScript in a JSP?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Surest Uncle", please check your private messages for an important administrative matter.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "open" or "closed" session?

If you are in a JSP, there will be a valid session. Are you trying to discover if the previous session has expired and you are in a new one?
 
Ali Khalfan
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
don't think you could use javascript to access a session variable, why not store some variable in a session and then display it on the page somewhere..if it shows null then you'll know
 
Prasad Tamirisa
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is also one of the ways, but not using java script.

Use reqeust.getSession() in a scriptlet and find out if the session is dead or active.
[ May 24, 2008: Message edited by: Prasad Tamirisa ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic