Best way to write multiple cookies in JSP?
Posted on 2004-08-16
I have a form that I need to retain specific field information for the customer when they return to use the form multiple times.
I was thinking of writing a cookie to keep the things like 'PHONE', 'EMAIL_ADDRESS', etc. upon execution of the form. That way I can have the form look for the cookie and pre-populate the field for the customer.
My question is, what is the best way to write this cookie or cookies when one is needing to store multiple field values? Is there a limit to how many cookies I can write for one form? Do I write a new cookie for each field?
If I am going about this the wrong way, and there is a better way, then please let me know.
Also, after the cookie is written, do I need to check if the cookie exists, and not write a new one? (I was planning on having the cookie be good for 6 months)