I want to know session is active or not

Posted on 2012-08-13
Last Modified: 2012-08-17
Hi All

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

According to that i want to termnate child session window
Question by:stmani2005
    LVL 36

    Expert Comment

    by:Loganathan Natarajan
    try with,
    HttpSession session = req.getSession();
    LVL 36

    Expert Comment

    by:Loganathan Natarajan
    check out this, Session
    LVL 8

    Author Comment

    How could i know the status

    if session is active or destroyed
    LVL 2

    Accepted Solution


    You can check by apply the comparision with null value.

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

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now