I have a cookie which will jump over the opening index.htm file provided I have been there during the past 24 hours and instead go to "chapter_1e.htm" or "chapter_1.htm" depending on where I was last.
The cookie seems to function when I am inside the system with all the files but when I start from outside I will wrongly come to the index.htm file page. Cannot the system find the cookie or what can be the reason?
cookie.js
var expDate = new Date();
expDate.setTime(expDate.getTime()+365*24*60*60*1000/365); // one day
var cookieStr = document.cookie;
var startSlice = cookieStr.indexOf(isName+"=");
if (startSlice == -1){return false}
var endSlice = cookieStr.indexOf(";",startSlice+1)
if (endSlice == -1){endSlice = cookieStr.length}
var isData = cookieStr.substring(startSlice,endSlice)
var isValue = isData.substring(isData.indexOf("=")+1,isData.length);
return isValue;
}
The above script functions when index.htm is called from inside , i.e. when I work with files belonging to www.xxxx.com. Instead of open the index.htm page, you are directed to chapter1e.htm or chapter1.htm, when you click on index.htm, which is the objective.
However, when you start www.xxxx.com from outside by clicking you will open the index.htm page, even if you have visited the page only a short time before. The purpose was of course to open chapter1e. or chapter1, directly, provided you have visited the index.htm page during the last 24 hours.
My question is if the reason is a mistake in the programming or if the reason is security settings of the computer? www.xxxx.com is shown as a secure page in my settings.
Bookmarks