File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cookie

 
Amit Mohan Tiwari
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Prabhakar Rao
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cookies are for session management.
They are stored in Session Scope.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Naresh Waswani
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The values too stored in the browser?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic