wood burning stoves*
The moose likes JSP and the fly likes Cookie Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Cookie Problem" Watch "Cookie Problem" New topic
Author

Cookie Problem

ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403
Hi,

I am creating a cookie with Struts action called using Ajax function, after cookie gets created, i am reading it on the same page but i am not able to get new cookie name/values, if i refresh this page, i am able to see new cookie value. So, is it necessary to refresh to get new cookie values ?


Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Cookies are created by the browser as a result of sending the proper headers, so yes, the cookie isn't actually created until the response is sent to the browser.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
John Pradeep.v
Ranch Hand

Joined: Jul 21, 2008
Posts: 59
ujjwal soni wrote:Hi,

I am creating a cookie with Struts action called using Ajax function, after cookie gets created, i am reading it on the same page but i am not able to get new cookie name/values, if i refresh this page, i am able to see new cookie value. So, is it necessary to refresh to get new cookie values ?


Can you please post the piece of code where you read the cookie?
 
GeeCON Prague 2014
 
subject: Cookie Problem