• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 344
  • Last Modified:

cookie example


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

import java.io.IOException;
import java.io.PrintWriter;
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","worlddddd.com");
    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
  • 2
1 Solution
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
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'.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now