Forums Register Login

Storing data in cookies

+Pie Number of slices to send: Send
Hi All,
Thanks a lot in advance.
How can we store data in cookies.
i.e., I have search functionality where user can search for various things, If user searched for some f1, f2 in previous times then suppose if he is searching for third I need to show earlier searchs like f1 and f2. As we dont have any user specific data we should keep this data in some cookies.
Please help me.
And one more without user information how can we store data in data base, like i dont have any user id or any thing user specific and if he came back after some days how I can I show his/her previous data.

Regards,
Sree
+Pie Number of slices to send: Send
See the JavaDocs for HttpServletResponse for methods to set cookies.
For retrieval of cookie data see HttpServletRequest JavaDocs.
For the related Http standard see the RFC 2965.

Every Java programmer working with servlets should have the Javadocs on hand for questions like this.

Bill
+Pie Number of slices to send: Send
you can probably use a unique identifier (key value pair having a uniquely generated name) as part of your cookie string to identify the user...technically it is the machine/login that you are referring to. This might work until the user clears his cookies. I believe I did understand your requirements.
Put the moon back where you found it! We need it for tides and poetry and stuff. Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 790 times.
Similar Threads
Why no mutiple inheritance
How show page wise Results Displaying in JSP
Key disableing from our Application
cookies usage
A flatland puzzle
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 03:53:38.