cookie example


I was running below cookie example. I do not see my cookie name printed. How to fix it

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CookieEx extends HttpServlet{
  public void doGet(HttpServletRequest request, HttpServletResponse response)
  throws IOException{
    PrintWriter pw = response.getWriter();
    Cookie cookie = new Cookie("site","");
    cookie.setMaxAge(60*60); //1 hour
    pw.println("Cookies was generated");

Open in new window

Do I supposed to use sytem out or print writer as below



How do i view all recent cookies in IE and mozilla and chrome.
Please advise.

Any links resources ideas highly appreciated. Thanks in advance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
In Firefox, go to Tools -> Options -> Privacy.  Select Custom setting in the middle of the dialog window and a button to show your cookies will appear.
Firefox Options

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gudii9Author Commented:
How to check in IE and chrome as well?l  use them more. Please advise
Dave BaldwinFixer of ProblemsCommented:
I don't know of any way to check cookies in IE although there is a directory that is used to store them.  In Chrome, go to 'Setting' -> 'Content Settings' under Privacy and click on 'All Cookies and Site Data'.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.