| Member List |
| Posted: 06 Mar 2007 21:58 | ||
|
Registered User Currently Offline |
Posts: 2 Join Date: Mar 2007 |
|
|
Amazing tutorial...quick follow up with the flex login. Is there a way to tie in a session variable into the login system? So that, lets say...you want your user to be able to write a comment or something....the variable would be able to identify who made that comment. I was thinking that you could pass the session variable created with the php script back in the xml that is returned to the flex application. Any ideas?
Thanks again for a really well written tutorial! W |
||
| Posted: 07 Mar 2007 11:56 Last Edited By: danielneri | ||
|
Administrator Currently Offline |
Posts: 159 Join Date: Oct 2006 |
|
|
Well what I have done in an extended version of the login system is create a cookie right before the php script outputs "yes".
Code:
if(!$result) { $Return .= "no"; }else{ setcookie("name_of_cookie","username,time()+604800,"/"); $Return .= "yes"; } Hope that helps! __________________ ![]() |
||
| Posted: 08 Mar 2007 19:22 | ||
|
Registered User Currently Offline |
Posts: 2 Join Date: Mar 2007 |
|
|
That points me in the right direction...I am still confused as to how to incorporate this cookie into Flex however. Is there a way you could show a simple example of how to use the cookie in Flex? Am I on the right track if I try to create a public variable and assign it the value from the cookie?
Thanks again!!! W |
||
| Posted: 10 Mar 2007 13:21 | ||
|
Administrator Currently Offline |
Posts: 159 Join Date: Oct 2006 |
|
|
Walrus,
What I did is have an httpservice that is run at the start which points to a php file which then checks if a cookie is set Code:
if(isset($_COOKIE['username'])) { echo '<cookie>yes</cookie>'; }else{ echo '<cookie>no</cookie>'; } then flex checks the result and does whatever action is the result is true or false. I know it's a bad explanation but I'm in a hurry, tell me if you don't get it and ill explain in further detail __________________ ![]() |
||
| Posted: 22 Sep 2008 22:17 | ||
|
Registered User Currently Offline |
Posts: 2 Join Date: Sep 2008 |
|
|
Could you elaborate on this more?
I am trying to make it so that when a user logs in, the userid (from the users table) is stored in a SESSION or COOKIE so that when, the user enters the "Members Area" the datagrids there can run PHP/MySQL statements pertaining to the userid e.g SELECT * FROM approvedMedia WHERE userid=$_SESSION['userid']; or something similar. Please help! |
||
| Posted: 02 Nov 2011 22:10 | ||
|
Registered User Currently Offline |
Posts: 41 Join Date: Oct 2011 |
|
|
Oh you are very lucky. I can help you __________________ |
||