• 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

Cookie

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone tell me the following

Cookie(Stirng name , String value)

where the name and value of the cookies are stored ?
Is it stored in any context? if it is then which context?
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cookies are for session management.
They are stored in Session Scope.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Prabhakar Rao:
Cookies are for session management.
They are stored in Session Scope.



Not true.
On particular type of cookie may be used for session managment.
Your cookies are stored in the user's browser.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cookies are stored on the client system.

how the server gets these cookies from the client is in the form of header.

when the client sends a request to the server, it pass some information in the headers. one of the headers is

Set-cookie. this header contains name-value pairs and if there are more than on name-value pair it just separates them by ','.

for ex. if there are two cookies

name1 and value1 AND name2 and value2

the Set-cookie header looks like this:

Set-Cookie : name1=value1,name2=value2;

the server looks for this header name and once found he creates Cookie objects when you say request . get Cookies method.

Like Cookie c1 = new Cookie("name1","value1");
Cookie c2 = new Cookie("name2","value2");

I hop i made it clear.

regards

Naresh Waswani
9986461501
 
Amit Mohan Tiwari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The values too stored in the browser?
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic