Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
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:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JSP
Test for Session
Surest Uncle
Greenhorn
Posts: 1
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How do I
test
for Session either open or closed using javaScript in a
JSP
?
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
"Surest Uncle", please check your private messages for an important administrative matter.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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?
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Ali Khalfan
Ranch Hand
Posts: 129
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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 ]
Regards,
Durga Prasad
Won't you be my neighbor? - Fred Rogers. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
When is a HttpSession object created by the Web Container
Posting session variables in single JSP page
Checking for Session Timeout
Struts and cactus please help
click button to clear session
More...