bug 238045 - Cookie manager of 1.7beta does not display stored cookies, r=mvl, sr=darin, a=chofmann, display a blank value for expiry if FormatDateTime chokes on really long-lived cookies

This commit is contained in:
mconnor%myrealbox.com 2004-03-31 00:38:17 +00:00
parent aef3144b57
commit c48af3a33a
4 changed files with 62 additions and 26 deletions

View File

@ -197,15 +197,22 @@ function cookieDeny()
function GetExpiresString(secondsUntilExpires) {
if (secondsUntilExpires) {
var expireDate = new Date(1000*secondsUntilExpires);
return gDateService.FormatDateTime("", gDateService.dateFormatLong,
gDateService.timeFormatSeconds,
expireDate.getFullYear(),
expireDate.getMonth()+1,
expireDate.getDate(),
expireDate.getHours(),
expireDate.getMinutes(),
expireDate.getSeconds());
var date = new Date(1000*secondsUntilExpires);
// if a server manages to set a really long-lived cookie, the dateservice
// can't cope with it properly, so we'll just return a blank string
// see bug 238045 for details
var expiry = "";
try {
expiry = gDateService.FormatDateTime("", gDateService.dateFormatLong,
gDateService.timeFormatSeconds,
date.getFullYear(), date.getMonth()+1,
date.getDate(), date.getHours(),
date.getMinutes(), date.getSeconds());
} catch(ex) {
// do nothing
}
return expiry;
}
return cookieBundle.getString("atEndOfSession");
}

View File

@ -276,10 +276,21 @@ function loadCookies() {
function GetExpiresString(expires) {
if (expires) {
var date = new Date(1000*expires);
return gDateService.FormatDateTime("", gDateService.dateFormatLong,
gDateService.timeFormatSeconds, date.getFullYear(),
date.getMonth()+1, date.getDate(), date.getHours(),
date.getMinutes(), date.getSeconds());
// if a server manages to set a really long-lived cookie, the dateservice
// can't cope with it properly, so we'll just return a blank string
// see bug 238045 for details
var expiry = "";
try {
expiry = gDateService.FormatDateTime("", gDateService.dateFormatLong,
gDateService.timeFormatSeconds,
date.getFullYear(), date.getMonth()+1,
date.getDate(), date.getHours(),
date.getMinutes(), date.getSeconds());
} catch(ex) {
// do nothing
}
return expiry;
}
return cookieBundle.getString("AtEndOfSession");
}

View File

@ -197,15 +197,22 @@ function cookieDeny()
function GetExpiresString(secondsUntilExpires) {
if (secondsUntilExpires) {
var expireDate = new Date(1000*secondsUntilExpires);
return gDateService.FormatDateTime("", gDateService.dateFormatLong,
gDateService.timeFormatSeconds,
expireDate.getFullYear(),
expireDate.getMonth()+1,
expireDate.getDate(),
expireDate.getHours(),
expireDate.getMinutes(),
expireDate.getSeconds());
var date = new Date(1000*secondsUntilExpires);
// if a server manages to set a really long-lived cookie, the dateservice
// can't cope with it properly, so we'll just return a blank string
// see bug 238045 for details
var expiry = "";
try {
expiry = gDateService.FormatDateTime("", gDateService.dateFormatLong,
gDateService.timeFormatSeconds,
date.getFullYear(), date.getMonth()+1,
date.getDate(), date.getHours(),
date.getMinutes(), date.getSeconds());
} catch(ex) {
// do nothing
}
return expiry;
}
return cookieBundle.getString("atEndOfSession");
}

View File

@ -276,10 +276,21 @@ function loadCookies() {
function GetExpiresString(expires) {
if (expires) {
var date = new Date(1000*expires);
return gDateService.FormatDateTime("", gDateService.dateFormatLong,
gDateService.timeFormatSeconds, date.getFullYear(),
date.getMonth()+1, date.getDate(), date.getHours(),
date.getMinutes(), date.getSeconds());
// if a server manages to set a really long-lived cookie, the dateservice
// can't cope with it properly, so we'll just return a blank string
// see bug 238045 for details
var expiry = "";
try {
expiry = gDateService.FormatDateTime("", gDateService.dateFormatLong,
gDateService.timeFormatSeconds,
date.getFullYear(), date.getMonth()+1,
date.getDate(), date.getHours(),
date.getMinutes(), date.getSeconds());
} catch(ex) {
// do nothing
}
return expiry;
}
return cookieBundle.getString("AtEndOfSession");
}