I set this cookie in a folder Inetpub/www/picco/asp
and within a file called net1.asp
Code:
function setOWCookie(NameOfCookie, value, expiredays)
{
var url = location.href; // the current URL of the page (e.g. airbook.asp)
var airbook = url.indexOf("air_book");
var netfare3 = url.indexOf("net_fare3");
// Three variables are used to set the new cookie.
// The name of the cookie, the value to be stored,
// and finally the number of days until the cookie expires.
// The first lines in the function convert
// the number of days to a valid date.
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
// The next line stores the cookie, simply by assigning
// the values to the "document.cookie" object.
// Note the date is converted to Greenwich Mean time using
// the "toGMTstring()" function.
document.cookie = NameOfCookie + "=" + escape(value) +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()) + "domain=localhost";
// If the current page is the airbook
if(airbook!=-1)
{
var returning = document.getElementById("returning");
returning.style.visibility="hidden";
var returning_zelle = document.getElementById("returning_zelle");
returning_zelle.style.visibility="hidden";
var OpnJw = document.getElementById("OpnJw");
OpnJw.style.display="none";
}
}
However, i want to access it in Inetpub/www/picco/asp/includes
and within a file called net1_include.asp
But this code below doesn't work, when trying to delete the cookie.
Code:
/*
FUNCTION NAME: delCookie
Deletes the cookie name that is passed to the function,
can be used for OJ and OW cookies
*/
function delCookie(NameOfCookie)
{
// The function simply checks to see if the cookie is set.
// If so, the expiration date is set to Jan. 1st 1970.
if (retrieveCookie(NameOfCookie,"DEL"))
{
document.cookie = NameOfCookie + "=; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
Any help appreciated.
Picco
www.crmpicco.co.uk