mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
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:
parent
aef3144b57
commit
c48af3a33a
@ -197,15 +197,22 @@ function cookieDeny()
|
||||
|
||||
function GetExpiresString(secondsUntilExpires) {
|
||||
if (secondsUntilExpires) {
|
||||
var expireDate = new Date(1000*secondsUntilExpires);
|
||||
return gDateService.FormatDateTime("", gDateService.dateFormatLong,
|
||||
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,
|
||||
expireDate.getFullYear(),
|
||||
expireDate.getMonth()+1,
|
||||
expireDate.getDate(),
|
||||
expireDate.getHours(),
|
||||
expireDate.getMinutes(),
|
||||
expireDate.getSeconds());
|
||||
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(),
|
||||
|
||||
// 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,
|
||||
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,
|
||||
expireDate.getFullYear(),
|
||||
expireDate.getMonth()+1,
|
||||
expireDate.getDate(),
|
||||
expireDate.getHours(),
|
||||
expireDate.getMinutes(),
|
||||
expireDate.getSeconds());
|
||||
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(),
|
||||
|
||||
// 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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user