• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference Between Javascript Cookie and serverside Cookie?

 
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic