invaz
11-27-2005, 09:53 PM
Hi,
It would be great help if anyone could help me overcome a cookie problem. I have an ASP code which I’d like to convert to JSP. The problem here is that ASP allows me to set 2 dimensional cookies, but I don’t think JSP allows this. May I know any suggestions to the solution?
ASP code:
dim pageName, userName, bmValid, temp
pageName = request.querystring("bookmark")
temp = Split(pagename,"=",-1)
userName = session("current")
Response.cookies(userName)("page") = temp(0)
Response.cookies(userName)("frame") = temp(1)
Response.cookies(userName).Expires = Now() + 30
JSP Code:
String username = session.getAttribute("Current").toString();
String bookmark = request.getParameter("bookmark");
if(username==null) username="";
Date now = new Date();
String timestamp = now.toString();
Cookie cookie = new Cookie (username,bookmark);
cookie.setMaxAge(365 * 24 * 60 * 60);
response.addCookie(cookie);
It would be great help if anyone could help me overcome a cookie problem. I have an ASP code which I’d like to convert to JSP. The problem here is that ASP allows me to set 2 dimensional cookies, but I don’t think JSP allows this. May I know any suggestions to the solution?
ASP code:
dim pageName, userName, bmValid, temp
pageName = request.querystring("bookmark")
temp = Split(pagename,"=",-1)
userName = session("current")
Response.cookies(userName)("page") = temp(0)
Response.cookies(userName)("frame") = temp(1)
Response.cookies(userName).Expires = Now() + 30
JSP Code:
String username = session.getAttribute("Current").toString();
String bookmark = request.getParameter("bookmark");
if(username==null) username="";
Date now = new Date();
String timestamp = now.toString();
Cookie cookie = new Cookie (username,bookmark);
cookie.setMaxAge(365 * 24 * 60 * 60);
response.addCookie(cookie);