• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with cookies  RSS feed

 
Syamsul Hussin
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, i've got this major problem with cookies,

I've got a form, and when the user clicks the submit button, a new cookie will be constructed (based on info entered by the user), and

is called.

I've got a protion of the jsp that will get all cookies via

and prints out all cookies to the webpage.

The problem is, I have to refresh the page after clicking submit in order for the webpage to print the cookie (it doesnt display after the click).

I've tried these combinations of getting the cookies first, then adding them and adding them and then getting them back.

On the other hand, cookie.setValue() seems to work instantaniously (displays changes after a click).

I'm very confused as why this is happening. All help welcomed, thanks in advance.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because you can't read a cookie that's been added to the user's browser until the user posts again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!