Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Cookie

 
Greenhorn
Posts: 10
  • 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?
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
The values too stored in the browser?
 
No holds barred. And no bars holed. Except this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic