Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can JSP read JavaScript cookies.

 
Gerard Largosa
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way for JSP to read JavaScript cookies? If no, what is an alternative way to exchange information from Javascript to JSP. Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cookies, while available from JavaScript, are not a JavaScript-specific mechansism. Cookies are available on the server-side via the getCookies() method of the request isntance.

But why use cookies? If you are going to be making a request back to the server, why not just use good old request params?
 
Gerard Largosa
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tried the getcokies() method it works, thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!