This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I need some help in Cookie. I have created a servlet, where i need to create a cookie which will hold value some of user id which is given in a login page. Code of the login page is not available, only url is known. Along this url a return url is added. After successful validation servlet will redirect to that return url. This login page is invoked from my servlet only.
Can any one suggest a way, by which I can capture the required information in side a Cookie.
N.B: I have tried Cookie cookie=request.getCookies(); and it's not working.
Is anything other than your Serlvet accessing this Cookie? What initially created the Cookie?
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower
If you want to store your value in client browser then use cookie.
That should work , the work flow is for the first request the client will not have the value in cookie but after that you will have that value in cookie .
Joined: Sep 14, 2011
Hi Pete, Miku
Thanks for your suggestions. Few days ago I just came to know that value of the cookies were encrypted and the original value can be retrieved after following some formalities.