Title: RE: [Tapestry-developer] [OT] need a quick cookie pointer

Cookie is the way to go.

Look at
javax.servlet.http.Cookie
javax.servlet.http.Response.addCookie
javax.servlet.http.Request.getCookies

Set the max age of the cookie to be -1.

So: Each call: look for your cookie in the array you
get back from the request. Sadly it's an array, not a
Map.

If there is no cookie, create one with max age -1
and add the cookie to the response.

Voila.




-----Original Message-----
From: Geoff Longman [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 5:06 PM
To: [EMAIL PROTECTED]
Subject: [Tapestry-developer] [OT] need a quick cookie pointer


Have an oppotunity to make a quick score formy employer.  Customer needs to
know if a visitor has been to a page (served by a Servlet)before. If the
user is new they will need to fill out a form.

I'm thinking cookie. Anybody know how to work with cookies in a Servlet? I
never needed to before.

Sorry this isn't Tapestry related, but you people are Extra Servlet-Aware!
:-)

If I can pull this off it'll go a long way to getting a little less pressure
here at work to
stop spending so much time working on Spindle. Free time is a luxury and
*everyone* wants some of it!

Geoff

Geoffrey Longman
Intelligent Works Inc.





-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to