HOME      BLOG       FORUMS      CONTACT       ABOUT

Find out session created time in JSP/Servlet

Find out session created time in JSP/Servlet

The getCreationTime of HttpSession interface allows us to find out the time in which the session was created in JSP and Servlet.

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession();
		long creationTime = session.getCreationTime();
		
		System.out.println("Session created time = "+creationTime);
	}

Share

Tags: ,


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply