• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cookie Problem

 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
John Pradeep.v
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic