Cookies are used basically for the purpose of session management. How it works is. The server associates a cookie with a web client. It will send the cookie along with the response to the web client. THe web client then while responding will send the cookie back without changing it. So it can be used to do :
1. Session Tracking
2. Authentication
3. Any specific user information eg. shopping carts.
How the server sets the cookie is implementation dependent. It can be set once the user hits the site. Or it can be set when the user logs in. So once the cookie is set, all the communication between the web client and server will happen and server will identify the client on the basis of the cookie.
In some browser the cookies are disabled. SO in that case how should one do session tracking? It can be done by using the specific methods in the response object.
response.encodeURL();
response.encodeRedirectedURL();
WHat these functions do is. THey encode the URL specified as the parameter to the function and append the session id to it.
Can a class be static?
http://www.javaworld.com/javaworld/javaqa/1999-08/01-qa-static2.html
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment