Switch to full style
JSP Code Examples
Post a reply

session in jsp

Sat Jan 24, 2009 12:28 am

You can get session ID in jsp and the time of its created , and also the time of the last access to page by the user .


Code:
<%@page import "java.util.Date" session="true"%>
<
HTML
    <
HEAD>
        <
TITLE>Session in JSP (Codemiles)</TITLE>
    </
HEAD

    <
BODY>
      
        <
h1>Session in JSP</h1>
        
Your session ID is :  <%=session.getId()%>
        <
br>
        
Session created at  <%=new Date(session.getCreationTime())%>
        <
br>
        
Last time of activity <%=new Date(session.getLastAccessedTime())%>
        <
br>
         
    </
BODY
</
HTML>
 




The output of the code is :
Code:

Your session ID is : 7DF1641B1708A61B84652D34EEE39BB8
Session created at Sat Jan 24 01:27:07 EET 2009
Last time of activity Sat Jan 24 01:27:07 EET 2009




Post a reply
  Related Posts  to : session in jsp
 PHP session variables     -  
 EJB session bean     -  
 Session Valid     -  
 php login with session     -  
 Modify Session Variables     -  
 Delete session variable     -  
 Session handling using Struts     -  
 Login using session with php and mysql     -  
 tomcat session tracking     -  
 EJB 3.0 Stateful Session Bean Example     -  

Topic Tags

Servlets/JSP