Hi Rosdi,
Your right on the money as far as the cookies and the javascript. It is
much easier to do at a browser level in javascript.
The thing I was trying to accomplish is to save multiple values
and retrieve them from a cookie to be used in the
body of my servlets.
>From the list I should investigate the use of Session Var's. My only
worry with using Sessions is on the production system we use
webserver load balancing software with 4 different web server boxes.
So my concern is that the load balancing software does not redirect
the request to the same server thus the session information is lost.
Then again I could be totally confused about how sessions work.
James Tuan
Rosdi Sedi wrote:
>
> Bruno & James,
>
> I did understand Bruno's problem. I faced the exact same problem quite some
> time ago (imagine writing a servlet for Netscape Enterprise which supports
> (supposedly) only jsdk 1.0!).
>
> What I did (which I think much simpler than what James did, however less
> secure) was having the javascript to check the existence of the cookie.
> the cookie doesn't exist, create one (with appropriate lifespan, say.. 1
> day) then have the javascript to redirect the viewer to 'new visitor page'
> the url will probably looks like this:
> http://the.server/servlet/myServlet?new=1
>
> The servlet can then check the existence of the 'new' parameter. When the
> same viewer visits my site, the javascript will notice that the cookie is
> already there and redirect the viewer to:
> http://the.server/servlet/myServlet?new=0
>
> Oh yes!, of course someone can easily fool my servlet easily by changing the
> 'new' value to 1, which will make him/her a new visitor all the time.
>
___________________________________________________________________________
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