[thelist] ASP Cookies

Chris Blessing webguy at mail.rit.edu
Thu May 2 10:02:00 CDT 2002


Josh-

Have you tried setting the cookie with Javascript instead of ASP?  I know
you're probably performing some server-side data validation, and JS can be a
PITA for this sometimes, but it's a possibility.

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

> Well, I found a work around using the escape function of javascript.  It's
> not so great, though, since it doesn't escape the "+" that was
> the encoding
> for spaces. I replaced the "+" with spaces, but that means no "+" can be
> inputted in the form since JS can't determine which are encoded and which
> are purposeful.
>
> Let me give some background on my application.  I have a form which spans
> three html pages since it is too big to fit on one.  As the user fills out
> each page, the values of that page are stored in a cookie (using
> ASP), which
> is submitted at the end of the entire form (e.g. after page
> three).  In the
> event that the user hits the backbutton, the JS reads the cookie and puts
> the previously inputted values as the default value of the form.
>
> The problem with putting the value of the cookie using
> <%=request.cookie("cookiename")%> is that when the back button is hit, the
> value in the cached page which JS is working off of doesn't change, so the
> values on the page doesn't change. Therefore, I need to use the
> value of the
> cookie from JS.
>
> If you have any other ideas about how to accomplish the same
> functionality,
> I would be glad to hear them.  Specifically, the question is how to best
> implement multiple forms while allowing for the fact that users will hit
> their back button.
>
> Take care,
> Josh




More information about the thelist mailing list