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

Difference Between Javascript Cookie and serverside Cookie?

 
Ravi Kumar Ravuru
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Folks,
I would like the difference between Javascript Cookie and serverside Cookie?What are the advantages of both ways?Please help me out.
Regards,
Ravi
 
Gary Mann
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you mean by "server side cookie". If you mean setting cookie headers in a servlet, then this results in the same cookies (stored on client) accessible from JavaScript.
 
Ravi Kumar Ravuru
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Gray Man,
Server-side cookies means cookies set through servlets using cookie api.What are the advantages of javascript cookies over server-side cookies.Awaiting your reply.
Regards,
Ravi
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ravi Kumar R.S:
Hello Gray Man,
Server-side cookies means cookies set through servlets using cookie api.What are the advantages of javascript cookies over server-side cookies.Awaiting your reply.
Regards,
Ravi

Well, you already know about server side cookies using servlets/JSP, with client side JavaScript, you instruct the JavaScript/JScript engine of the browser to place a cookie for you, so the code will essentially be executed on the client-side. With server side cookie, the cookie is set through HTTP header. If the client browser has disabled JavaScript, setting cookies via JavaScript won't work. JavaScript cookies come in handy when your web-server (free or low cost web server) does not allow you to use a server side programming.
Obviously, if cookies are disabled, both the approaches won't work. You can read more about JavaScript cookies here -
http://www.geocities.com/technofundo/tech/js/jscookies.html
see if it is of any help.
- Manish
 
Your mind is under my control .... your will is now mine .... read this tiny ad
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!