[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Problm with non-cookie browser!
****** message to minivend-users from Barry Treahy <treahy@mmaz.com> ******
I cannot take credit for writing the original JS, but I did modify it to better meet my needs...
var today = new Date();
var todays_date = new
Date(today.getYear(),today.getMonth(),today.getDate(),today.getHours(),today.getMinutes(),today.getSeconds());
// Week Day Hour Min Sec Mill
var expires_date = new Date(todays_date.getTime() + (1 * 1 * 1 * 15 * 60 * 1000));
function Get_Cookie(name) {
var start = document.cookie.indexOf(name+"=");
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
if (start == -1) return null;
var end = document.cookie.indexOf(";",len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len,end));
}
function Set_Cookie(name,value,expires,path,domain,secure) {
var newcookie = name + "=" +escape(value) +
( (expires) ? ";expires=" + expires.toGMTString() : "") +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
( (secure) ? ";secure" : "");
document.cookie = newcookie;
}
function Delete_Cookie(name,path,domain) {
if (Get_Cookie(name)) document.cookie = name + "=" +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
jojo wrote:
> ****** message to minivend-users from jojo <hans-joachim.leidinger@home.gelsen-net.de> ******
>
> Hello Barry,
>
> you are a right person! :-)
> I will be happy, if you give me your set of JavaScript routines to do a
> simple get_cookie test.
> If someone has the same solution with perl code, please let me know.
>
> Thank you a lot!
>
> Joachim
>
> Barry Treahy wrote:
> >
> > ****** message to minivend-users from Barry Treahy <treahy@mmaz.com> ******
> >
> > I can't say for MV, but I have a set of JavaScript routines that I'd be happy to e-mail you which will allow you to do a
> > simple get_cookie test and if the cookie exists, you know that it was set at some point and has not expired. If the cookie
> > doesn't exist, you can use another routine set_cookie to fix it...
> >
> > Barry
> >
>
> --
> Hans-Joachim Leidinger hans-joachim.leidinger@home.gelsen-net.de
>
> -
> To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
> email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
> Archive of past messages: http://www.minivend.com/minivend/minivend-list
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list