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
LVL 9
Manikandan ThiagarajanSenior consultantAsked:
Who is Participating?
 
rajshekherCommented:
Hi,

You can check by apply the comparision with null value.

if ( Session["StaffId"] == null)
  -- Session is expired.
else
  -- Session is exists.
0
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.