Forums Register Login

storing server side cookie at client side

+Pie Number of slices to send: Send
Hi,

I was working on cookie and i had got this question for which i was not able to find the clue.

lets assume that we need to store a cookie at the client side using a javascript "document.cookie" so that it writes a cookie at the client side and this cookies will be there as long as we delete it and so when we say request.getCookies() we will get all the cookies stored at the client side whenever we open a new session.

But what if i want to add a cookie from the server side to client side. i.e at the server side i add a cookie using response.addCookie() and this will be there in the request as long as the session is valid / lives but i wanted to write this cookie into the client side and so this cookie will remain even after the session is closed and reopened

Thanks,
Suresh B
+Pie Number of slices to send: Send
The Cookie class has a method setMaxAge().

Guess what it does.
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1430 times.
Similar Threads
delete cookie from request ?
Session
cookie problem
URL-rewriting
Cookies
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:09:00.