Total members 11895 |It is currently Sun Dec 22, 2024 7:21 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : session in jsp
 EJB session bean     -  
 Session Valid     -  
 php login with session     -  
 PHP session variables     -  
 Session handling using Struts     -  
 Login using session with php and mysql     -  
 tomcat session tracking     -  
 EJB 3.0 Stateful Session Bean Example     -  
 Session destroy on navigate away     -  
 session Encoding Data in php     -  



Topic Tags

Servlets/JSP






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com