PDA

View Full Version : Cookie Redirect



hnpdyn
02-11-2006, 10:37 AM
This address: (http://javascript.internet.com/cookies/cookie-redirect.html) is cookie redirect scipt. Onclick=setting cookie.

This address: (http://www.perlscriptsjavascripts.com/js/cookie_redirect.html) is cookie redirect script. setcookie=seenit. (redirect if I have been here before)

The scripts above aren't work for me.
This is something I wanted.

EXAMPLE BELOW:

index.html = main page (content: <A href="english.html" target="inframe_page">English</A> | <A href="vietnam.html" target="inframe_page">Vietnamese</A>

ifrm.html = inframe_page
english.html = english page
vietnam.html = vietnamese language page

When a visitor first time visit my website, the would see the ifrm.html (inframe_page). But if s/he come back later, s/he won't see the ifrm.html page because I wnat it automatic redirect to english.html or vietnam.html depending on where s/he been last time (last visit) [last visit=setcookie]

Information: Can I set the page: setcookie by onclick in different page (index.html)
Or setcookie by unload the ifrm.html
Or setcookie by onload the english.html and/or vietnam.html

The information above may confuse you, please contact me or reply if you don't get it. That's all I can explain, because my English is limited. I hope someone can help me.

THANK THANK VERY MUCH! AND HOPE YOU HAVE A NICE DAY :-)

Hung!

jscheuer1
02-12-2006, 05:54 AM
Javascript cookies are unreliable due to a variety of reasons. Not the least of which are the user's ability to delete and/or refuse them and some browsers' refusal to set them (or do much of anything) onunload. Something server side would be better.