I\'ve initialized cooke like this in my JSP,
String timeStamp = new SimpleDateFormat(\"dd:MM:yyyy_HH:mm:ss:SSS\").format(Calendar.getInstance().getTime());
t
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String username = "";
String password = "";
// Get an array of Cookies associated with this domain
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
if (cookies[i].getName().equals("username")) {
username = cookies[i].getValue();
}
if (cookies[i].getName().equals("password")) {
password = cookies[i].getValue();
}
}
}
AccountDAO l = new AccountDAO();
Account a = l.getAll(username, password);
if (a != null) {
request.getRequestDispatcher("Detail.jsp").forward(request, response);
} else {
request.getRequestDispatcher("login.jsp").forward(request, response);
}
}