Hello,
I have a servlet that creates a cookie based on a sessionID. Now if the user closes
the browser and launches their browser again, I can display welcome back <username>.
What I need to do now is display a timestamp of when they last access their session
after the welcome <username>. Should I create another cookie as follows:
Cookie timeStampCookie = new Cookie("timeStamp",
DateFormat.getDateInstance(DateFormat.LONG).format(new
Date(session.getLastAccessedTime())));
res.addCookie(timeStampCookie);
if (cookies[i].getName().equals("timeStamp"))
String timeStamp = cookies[i].getValue();
out.println("Time :" + timeStamp);
Any help is appreciated.
Ro
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html