PDA

View Full Version : check if users last visit was at least 24 hours ago


twilight
08-29-2003, 06:32 PM
hi,
i would like to use a cookie on my site that would store the information about the users last visit. i found a script for it - http://javascriptkit.com/script/script2/lastvisit.shtml.

but i generally don't want the script to show the time of the last visit, but i would like it to check if the user was on the particular page more than 24 hours ago

so here's my question - is there a way of modifying the script so that the body part of the script would be somthing similar to this:

if(last_visit_over_24_hours)
{
document.write("your last visit was over 24hrs ago")
}
else if (!last_visit_over_24_hours)
{
document.write("you visited the site already during the past 24 hours")
}


thanks in advance for any info on this

Mr J
08-30-2003, 02:12 PM
The link you posted does not work.

can you post your code

liorean
08-30-2003, 02:19 PM
Hmm, you could write a cookie with a 24h expiry time, and then check if that cookie exists or not next time they visit.