# Flash MX cookies

**URL:** <https://forum.kirupa.com/t/flash-mx-cookies/10054>\
**Category:** Uncategorized\
**Created:** [December 23, 2002, 2:51pm UTC](https://forum.kirupa.com/t/flash-mx-cookies/10054 "2002-12-23T14:51:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wealoon](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@wealoon](https://forum.kirupa.com/u/wealoon)\
**Post date:** [December 23, 2002, 2:51pm UTC](https://forum.kirupa.com/t/flash-mx-cookies/10054/1 "2002-12-23T14:51:18Z")

</div>

hi … anyone can help with cookies in flash MX ?  
i have found the kirupa tutorial on flash mx cookies but if i am retrieving the cookie from another flash page, do i also do teh same thing?

that is i create teh cookie in one flash page

user = SharedObject.getLocal(“user\_profile”);  
user.data.name = name;  
user.flush();

do i hav to create teh cookies by scripting it to a button like in teh kirupa tutorial?

then on another page i just write :

user = SharedObject.getLocal(“user\_profile”);  
name = user.data.name;

to retrieve the cookie?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 23, 2002, 2:53pm UTC](https://forum.kirupa.com/t/flash-mx-cookies/10054/2 "2002-12-23T14:53:54Z")

</div>

[SIZE=1] **yeah!** [/SIZE]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 23, 2002, 3:56pm UTC](https://forum.kirupa.com/t/flash-mx-cookies/10054/3 "2002-12-23T15:56:02Z")

</div>

hmm… but i cant get it to work ☹

is it a must to put the :  
user.data.name = name;  
user.flush();

inside the on release{} ? button

or i can just put it on teh frame action itself

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 23, 2002, 6:00pm UTC](https://forum.kirupa.com/t/flash-mx-cookies/10054/4 "2002-12-23T18:00:43Z")

</div>

well what is happening there?  
do you want the name to be stored in the cookie with a click on the button or is it someway else?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 24, 2002, 6:18am UTC](https://forum.kirupa.com/t/flash-mx-cookies/10054/5 "2002-12-24T06:18:25Z")

</div>

on the login page,  
wat i hav done is load the script at the click of the button

loadVariablesNum(“post002.asp”,0,“GET”);

then after the execution of the script, it is suppose to return me two variables, one is a “go” variable to indicate whether login is successful or not (true or false) , the second is a variable named “xuserid” which is the userID i hav taken from the database to indicate which user have login.

then what i intended to do is set the xuserid as a cookie , do i put it as :

user = SharedObject.getLocal(“user\_profile”);

if (go == “true”) {  
user.data.login = “xuserid” ;  
user.flush();

getURL(“mainmenu.html”, “\_self”);  
}  
if (go == “false”) {  
gotoAndStop(“error”);  
}

and then i intend to retrieve it from another flash page. is it that i just put:  
user = SharedObject.getLocal(“user\_profile”);  
currentuserID = user.data.login;

then i will be able to retrieve the cookie?

thanx for the reply \<:}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 24, 2002, 8:40am UTC](https://forum.kirupa.com/t/flash-mx-cookies/10054/6 "2002-12-24T08:40:22Z")

</div>

yes that should retrieve the cookie! I see no problem why it shouldn’t… :-\
