How we can check in particular page the session will be alive or not?

Showing Answers 1 - 5 of 5 Answers

Kavitha

  • Oct 20th, 2005
 

U can use request.getSession(false); method in HttpServletRequest interface.It returns the HttpSession associated with this request or null if the request has no valid session.

Kavitha

  • Oct 20th, 2005
 

U can use request.getSession(false); method in HttpServletRequest interface.It returns the HttpSession associated with this request or null if the request has no valid session.

  Was this answer useful?  Yes

chetan

  • Jan 1st, 2006
 

u can use the isRequestedSessionValid() method or another method is to use the getRequestedSessionId() method and check with the session id we have by getting the requestedId by req.getSessionId()

  Was this answer useful?  Yes

siva kumar reddy

  • Jul 31st, 2006
 

 use this method

HttpSession session=request.getSession(false);

in this case the web container checks JSessionID is available on  behalf of client or not.

if session is alive it sends old session id.

if session is not available it returns null object.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions