Related information:
"21-Day Learning Java Web Development"
Session Object
Get additional information about the session
sessiondemo2.jsp
1 <%@ Page Language="Java"ContentType="text/html;charset=gb2312" %>2 <HTML>3 <Head>4 <title>Get additional information about the session</title>5 </Head>6 <Body>7 <%8 LongCreattime=session.getcreationtime ();//get the session generation time9 Out.println ("time generated by session:"+Creattime+"<br>");//output Session generation timeTen StringSessionID=Session.getid ();//get the ID of the session One Out.println ("ID of Session:"+SessionID+"<br>");//the ID of the output session A LongLasttime=session.getlastaccessedtime ();//gets the last time the request was sent through the session - Out.println ("last time the request was sent through the session:"+Lasttime+"<br>");// - Booleanisnew=session.isnew ();//determine if the session is new the Out.println ("Is the new:"+isnew);//output session is not new - %> - </Body> - </HTML>
View Code
The session object of the java-jsp built-in object gets additional information about the session