# Cookie redirect question

**URL:** <https://forum.kirupa.com/t/cookie-redirect-question/182837>\
**Category:** flash\
**Created:** [March 21, 2006, 8:56pm UTC](https://forum.kirupa.com/t/cookie-redirect-question/182837 "2006-03-21T20:56:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurdo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/saurdo/32/1583_2.png) [@Saurdo](https://forum.kirupa.com/u/Saurdo)\
**Post date:** [March 21, 2006, 8:56pm UTC](https://forum.kirupa.com/t/cookie-redirect-question/182837/1 "2006-03-21T20:56:44Z")

</div>

So i’m making a redirect using flash but once people get redirected to the page I don’t want them to get redirected twice. So that’s why I have the cookie. However I would like to redirect them to another page if they’ve already been redirected to the first page (which is what my cookie is for). So here’s the code that I have. If you guys could tell me what to do next that would be appreciated.

```auto
cookie=SharedObject.getLocal("mycookiename");
if(cookie.data.viewed==null)
{
    getURL("myurlhere", "_parent", "GET");
    cookie.data.viewed=1;
    cookie.flush();
}

```

---

<div class="post-metadata">

**Author:** ![evileks](https://avatars.discourse-cdn.com/v4/letter/e/cab0a1/32.png) [@evileks](https://forum.kirupa.com/u/evileks)\
**Post date:** [March 22, 2006, 6:28am UTC](https://forum.kirupa.com/t/cookie-redirect-question/182837/2 "2006-03-22T06:28:23Z")

</div>

I’m actually wondering this too, anyone got any ideas?

---

<div class="post-metadata">

**Author:** ![Saurdo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/saurdo/32/1583_2.png) [@Saurdo](https://forum.kirupa.com/u/Saurdo)\
**Post date:** [March 23, 2006, 1:24am UTC](https://forum.kirupa.com/t/cookie-redirect-question/182837/3 "2006-03-23T01:24:08Z")

</div>

Seriously, nobody knows? There has to be _some_ way to do this.

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 23, 2006, 2:01am UTC](https://forum.kirupa.com/t/cookie-redirect-question/182837/4 "2006-03-23T02:01:20Z")

</div>

sorry i didnt quite understand what you ment by

> 

If you guys could tell me what to do next

the code u have at the moment looks like it should work…  
so shouldnt it just b…

[COLOR=#0000ff]align[/COLOR]=[COLOR=#ff0000]“left”[/COLOR]\>cookie=[COLOR=#0000ff]SharedObject[/COLOR].[COLOR=#0000ff]getLocal[/COLOR]COLOR=#000000[/COLOR];  
ifCOLOR=#000000[/COLOR]  
[COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]getURL[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“myurlhere”[/COLOR], [COLOR=#ff0000]“\_parent”[/COLOR], [COLOR=#ff0000]“GET”[/COLOR][COLOR=#000000])[/COLOR];  
cookie.[COLOR=#0000ff]data[/COLOR].[COLOR=#000080]viewed[/COLOR]=[COLOR=#000080]1[/COLOR];  
cookie.[COLOR=#0000ff]flush[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR][COLOR=#0000ff]else[/COLOR][COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]getURL[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]

---

<div class="post-metadata">

**Author:** ![Saurdo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/saurdo/32/1583_2.png) [@Saurdo](https://forum.kirupa.com/u/Saurdo)\
**Post date:** [March 23, 2006, 2:43am UTC](https://forum.kirupa.com/t/cookie-redirect-question/182837/5 "2006-03-23T02:43:45Z")

</div>

Thanks for the reply but that’s not working.

Edit: Yes it did… Thanks!

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 23, 2006, 3:22am UTC](https://forum.kirupa.com/t/cookie-redirect-question/182837/6 "2006-03-23T03:22:57Z")

</div>

> [@Saurdo](#):
>
> Thanks for the reply but that’s not working.
> 
> Edit: Yes it did… Thanks!

no problem.!

yeah i just tested it again. i think i accidently put [COLOR=#0000ff]align[/COLOR]=[COLOR=#ff0000]“left”[/COLOR]\> at the begining of the last code i posted.

so when i tested it worked and the code was.

cookie1=SharedObject.getLocal(“mycookiename”);  
if(cookie1.data.viewed==null)  
{  
getURL(“firsttime.htm”,“\_blank”);  
cookie1.data.viewed=1;  
cookie1.flush();  
}else{  
getURL(“secondtime.htm”,“\_blank”);  
}

i change the"cookie" name to test it properly.
