Re: Cookie (Monster)

by Thomas James Allen <tjallen(at)pipeline.com>

 Date:  Wed, 24 Nov 1999 05:15:33 -0500
 To:  <kingben(at)bigfoot.com>
 Cc:  hwg-basics(at)hwg.org
  todo: View Thread, Original
At 10:01 PM 11/23/99 -0000, you wrote:
>Does anyone know of a script that can detect if a certain cookie (from my
>site) is on a user's system and then redirect them to a different page?
>I am trying to create a personalisation thing where users can display stuff
>on "their own custom start page" (doesn't it annoy you when sites say that
>and you know it's just using cookies to generate it real-time)
>so instead of loading up the normal frameset, if the cookie is there it
>needs to load up another frameset to get different page locations of the
>pages in the frame to render the code that the cookie data is from. ?!?!?
>Any ideas?
>
>Ben Bradley UK
---------------------------
Ben,
I'm not certain that I understand you, but maybe this helps:

Look at the cookie maker scripts at:
http://www.builder.com/Programming/Kahn/111997/

The function there called getCookie()
returns a "null" if the cookie is not there.

So use their script, and then you do this:

<script language="JavaScript">
<!-- hide script
var temp = getCookie('yourcookiename');
if (temp == null) {
        fwd = "index1.html";
        }       else    {
        fwd = "index2.html";
        }
}
location.replace(fwd)
// end hiding -->
</script>

Hope this helps,
jimmy
---
Jimmy Allen (Thomas James Allen)
Business - Get Your Website Here
http://www.getyourwebsitehere.com
Personal - Eclecticity
http://www.getyourwebsitehere.com/personal

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA