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
Родитель aef3144b57
Коммит c48af3a33a
4 изменённых файлов: 62 добавлений и 26 удалений

Просмотреть файл

@ -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");
}

Просмотреть файл

@ -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");
}

Просмотреть файл

@ -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");
}

Просмотреть файл

@ -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");
}