The cookies always expire when browser closes. When I look at safari's properties, my cookies have no expiration dates.
String hostName = ".aspireauctions.com";
String path = "/";
NSTimestamp currentTime = new NSTimestamp();
NSTimestamp expiration = currentTime.timestampByAddingGregorianUnits(1,0,0,0,0,0);
try {
cookieValueBidderID = URLEncoder.encode(bidderId.toString(),"UTF-8");
cookieValuePassword = URLEncoder.encode(password,"UTF-8");
}
catch(Exception e) {
System.out.println("Error encoding vookie");
System.out.println(e.toString());
}
// create cookie
try {
bidderIdCookie = new WOCookie("bidderid",cookieValueBidderID, path, hostName, expiration, false);
//bidderIdCookie.setTimeOut(timeout);
bidderPasswordCookie = new WOCookie("bidderpassword", cookieValuePassword, path, hostName, expiration, false);
//bidderPasswordCookie.setTimeOut(timeout);
}
catch(Exception e) {
System.out.println("Error creading bidder cookies");
System.out.println(e.toString());
}
if( (bidderIdCookie != null) && (bidderPasswordCookie != null) ) {
System.out.println(bidderIdCookie.headerString());
context().response().addCookie(bidderIdCookie);
context().response().addCookie(bidderPasswordCookie);
}