File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Cookies!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Cookies!!!" Watch "Cookies!!!" New topic


T Rai

Joined: Apr 16, 2002
Posts: 20
hi all,
i am trying to use cookies in a JSP to track requests associated with a user. The browser stores the cookies in the client machine, normally in a Cookies Folder in Document and Setting in C:\. is there any way that i can specify a particular place to store such cookies?
Another question is about cookies' definition that A cookie is a piece of text that a web server can store on a user's hard driver.I am having difficulty understanding how a web server can store a cookie on a user's hard driver? I read that a client sends the cookie information sent by a server and stored in the client machine. now how does the client browser store that cookie information sent by the server and how does it access again and send it to the server? could you please explain me this mechanism?
[ October 20, 2003: Message edited by: Thulung Rai ]
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
you as the webpage cannot determine where the cookie is stored because that would be bad security
what happens with cookies is your webpage sends the cookie back along with the webpage to the users browser. depending on which browser the user is using and what their preferences the browser may accept or decline the cookie. the browser will store the cookie wherever it wants. If it is a cookie just for one session it wont need to store it on the harddrive because it can keep it in memory but if it is for say 30 days some browsers store it as small text files on the users PC. when the user requests another page from the same site the browser does send along any cookies for that site.
hope that explains stuff better

Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
I agree. Here's the link:
subject: Cookies!!!
It's not a secret anymore!