mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
best I can do with this temporary fix for IE
This commit is contained in:
parent
b3e55f64a8
commit
1e8d954560
2 changed files with 13 additions and 13 deletions
|
@ -51,18 +51,20 @@ var randomString = require('./pad_utils').randomString;
|
||||||
|
|
||||||
var hooks = require('./pluginfw/hooks');
|
var hooks = require('./pluginfw/hooks');
|
||||||
|
|
||||||
function createCookie(name, value, days, path)
|
function createCookie(name, value, days, path){ /* Warning Internet Explorer doesn't use this it uses the one from pad_utils.js */
|
||||||
{
|
|
||||||
if (days)
|
if (days)
|
||||||
{
|
{
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||||
var expires = "; expires=" + date.toGMTString();
|
var expires = "; expires=" + date.toGMTString();
|
||||||
}
|
}
|
||||||
else var expires = "";
|
else{
|
||||||
|
var expires = "";
|
||||||
|
}
|
||||||
|
|
||||||
if(!path)
|
if(!path){ // If the path isn't set then just whack the cookie on the root path
|
||||||
path = "/";
|
path = "/";
|
||||||
|
}
|
||||||
|
|
||||||
//Check if the browser is IE and if so make sure the full path is set in the cookie
|
//Check if the browser is IE and if so make sure the full path is set in the cookie
|
||||||
if(navigator.appName=='Microsoft Internet Explorer'){
|
if(navigator.appName=='Microsoft Internet Explorer'){
|
||||||
|
|
|
@ -39,26 +39,24 @@ function randomString(len)
|
||||||
return randomstring;
|
return randomstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createCookie(name, value, days, path)
|
function createCookie(name, value, days, path){ /* Used by IE */
|
||||||
{
|
|
||||||
if (days)
|
if (days)
|
||||||
{
|
{
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||||
var expires = "; expires=" + date.toGMTString();
|
var expires = "; expires=" + date.toGMTString();
|
||||||
}
|
}
|
||||||
else var expires = "";
|
else{
|
||||||
|
var expires = "";
|
||||||
|
}
|
||||||
|
|
||||||
if(!path)
|
if(!path){ // IF the Path of the cookie isn't set then just create it on root
|
||||||
path = "/";
|
path = "/";
|
||||||
|
}
|
||||||
// This fixes an issue with IE not wanting to store cookies for Auth #1234. It's a temp fix because
|
|
||||||
// Really we should be storing the cookie on teh document.location path and not modifying the fsking URL to contain a password!
|
|
||||||
// document.cookie = name + "=" + value + expires + "; path=" + "/";
|
|
||||||
|
|
||||||
//Check if the browser is IE and if so make sure the full path is set in the cookie
|
//Check if the browser is IE and if so make sure the full path is set in the cookie
|
||||||
if(navigator.appName=='Microsoft Internet Explorer'){
|
if(navigator.appName=='Microsoft Internet Explorer'){
|
||||||
document.cookie = name + "=" + value + expires + "; path="+document.location;
|
document.cookie = name + "=" + value + expires + "; path=/"; /* Note this bodge fix for IE is temporary until auth is rewritten */
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
document.cookie = name + "=" + value + expires + "; path=" + path;
|
document.cookie = name + "=" + value + expires + "; path=" + path;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue