Question about user sessions
Hi, I'm looking for an example of how to name or store a session along with all of it's data when a user logs in to my site. Then log them out while I run a certain script, and at the end of it log them back in. Using the previously named session to log them back in automatically to re-register all of their global session variables.(I checked all of the session sections at php.net, they did'nt show how to do this)
I'm trying to make a songlist.xml.php for use inside of an AS XML object in flash. The trick is I need to use sessions inside of the xml.php to have it play many different user's MP3s when they are logged into their profile, and also when they use my site's search script.
I'm pretty sure I can't "sendandload" within flash's "soundObject" to post variables to the xml.php, so I must use session data to dynamically render the xml.php. So I register new global variables when you look at a member's profile from my search script to have his songs rendered in the xml.php. So at the end of xml.php I plan to destroy the "SESSION(search)" and replace it with "SESSION(originallyloggeduser)".
It's the only way I can figure out how to make the xml.php work correctly for thousands of people's profiles and a search script.
Thanks if you can help me.
Last edited by Webjedikungfu; 02-05-2007 at 04:13 AM.
Instead logging them out, why don't you set another session variable with a "pause" time: $_SESSION['take_a_break'] = time()+3;
Whenever you check for the existence of the session, check for the forced timeout and if the 3 seconds haven't gone by, show them a temporary page with a 3 second refresh back to where you want them.
This way, you'd never have to log them out at all.
Thanks nightshift, I think I get it. lemme try!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)