PDA

View Full Version : Last Time Visited script VS .tk and other redirects



Gabber
11-07-2004, 06:37 PM
I have a last visit date and time script on my homepage... but it stopped working using a redirect.
going directly to the page, the script works fine...always did! offline also!
going through a dot.tk type redirect address, the script always says it's my first visit.

here is the script:

<script language="javascript">
<!--


readCookie();

function readCookie() {
if (document.cookie == "") {
writeCookie();
alertMessage();
} else {
var the_cookie = document.cookie;
the_cookie = unescape(the_cookie);
the_cookie_split = the_cookie.split(";");
for (loop=0;loop<the_cookie_split.length;loop++) {
var part_of_split = the_cookie_split[loop];
var find_name = part_of_split.indexOf("nfti_date")
if (find_name!=-1) {
break;
} // Close if
} // Close for
if (find_name==-1) {
writeCookie();
} else {
var date_split = part_of_split.split("=");
var last = date_split[1];
last=fixTheDate(last);
alert ("Welcome back to WWW.THUNDERDOME.WEB.PT\n Last visited on "+last);
writeCookie();
} // Close if (find_name==-1)
}
} // Close function readCookie()


function writeCookie() {
var today = new Date();
var the_date = new Date("December 31, 2023");
var the_cookie_date = the_date.toGMTString();
var the_cookie = "nfti_date="+escape(today);
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie
}

function alertMessage(){
alert ("Welcome to WWW.THUNDERDOME.WEB.PT for the 1st time!\n Sign the guestbook and register yourself in the forum.")
}

function fixTheDate(date) {
var split = date.split(" ");
var fix_the_time = split[3].split(":")
var hours = fix_the_time[0]
if (hours>=12) {
var ampm="PM"
} else {
var ampm="AM"
}
if (hours > 12) {
hours = hours-12
}
var new_time = hours+":"+fix_the_time[1]+" "+ampm
var new_date = split[0]+" "+split[1]+", "+split[2]+" at "+new_time+", "+split[5]
return new_date;
}
//-->
</script>



---------------------------------------------------------------

and here is the source code of the redirect page:

-----------------------------------------------------------------


<html>
<HEAD>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>

<title>WWW.THUNDERDOME.WEB.PT</title>
</HEAD>

<script language="JavaScript">
<!--

function SymError()
{
return true;
}

window.onerror = SymError;

var SymRealWinOpen = window.open;

function SymWinOpen(url, name, attributes)
{
return (new Object());
}

window.open = SymWinOpen;

//-->
</script>

<script language='JavaScript'> </script>
<frameset frameborder=0 framespacing=0 border=0 rows='100%,*' >
<frame name=frame src='http://gabber.no.sapo.pt/index.htm'>
<frame name=framecontrol src=''>
</frameset>
<noframes>
<meta http-equiv=refresh content='0; url=http://gabber.no.sapo.pt/index.htm'>
</noframes>

<script language="JavaScript">
<!--

window.open = SymRealWinOpen;

//-->
</script>

</html>


-----------------------------------------------


now I can't figure out why the script does not work. all other scripts work and the page is filled with them. offline, and also online going directly to the page address, everything works just fine... :\
can you help me out?

greetz and thanx


ps: sorry for the long post

Gabber
11-11-2004, 12:09 AM
I can add that after more research, I concluded that many redirection services make cookies stop working!
why? how can I prevent this generally and in this specific case? :)

ausant
11-11-2004, 03:36 AM
thats ok.. the only way we understand is if you explain it properly and having a long post means so..
:)

Gabber
11-17-2004, 06:22 PM
cool... any news on how to sold this?

Gabber
01-16-2005, 02:58 AM
any news at all?

FPit
01-16-2005, 10:27 AM
Did it stop working in both frame and redirect, or meta refresh redirect only?

Gabber
01-19-2005, 01:15 AM
well, I had the metarefresh for a long time and it does work fine... see, even with some javascript redirects and metarefresh, going from index.htm to indexframe.htm works fine... because this script is in indexframe.htm.

but when one comes from thunderdome.tk that goes to index.htm that redirects to indexframe.htm... stuff does not work. it appears always as the first time I enter the page (and hence does not show me the time of last visit). so it is the thunderdome.tk redirect that causes the hassle (this one or other redirect service).

how can I overcome this?

thanks and greetz :D

Gabber
03-20-2005, 06:45 AM
Well, I guess I have exposed all the stuff... can you please give me a hand on this one? Thanks...

Gabber
06-20-2005, 08:11 PM
I've waited for months... any news on this one?
greetz

Twey
06-20-2005, 08:49 PM
Erm.
Cookies are stored by domain... can't think how that will affect it right at the moment but as far as I can see it's the only possible cause.
Are frames involved anywhere?

Gabber
06-25-2005, 02:57 AM
yes.... .tk domains use a frame that fits 100% of the screen for redirect... :|
Then the site opens in it...
This and other internet redirects use this....
I can overcome it by making the original page "pop out" of the frame... but I loose the smooth www.thunderdome.tk unchanged in the address bar...

I want a way to still have the www.thunderdome.tk in the address bar, and yet, make the cookie script work