• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 517
  • Last Modified:

I want to know session is active or not

Hi All

I want to know if session is active or expired in program.

According to that i want to termnate child session window
0
Manikandan Thiagarajan
Asked:
Manikandan Thiagarajan
  • 2
1 Solution
 
Loganathan NatarajanLAMP DeveloperCommented:
try with,
HttpSession session = req.getSession();
        session.getId();
0
 
Loganathan NatarajanLAMP DeveloperCommented:
check out this, Session
0
 
Manikandan ThiagarajanSenior consultantAuthor Commented:
How could i know the status

if session is active or destroyed
0
 
rajshekherCommented:
Hi,

You can check by apply the comparision with null value.

if ( Session["StaffId"] == null)
  -- Session is expired.
else
  -- Session is exists.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now