Variables from URLs? Or at least a way to...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Variables from URLs? Or at least a way to...

Post by Mightywayne »

Howdy! Glad to see DevNet is running well on its new server.

Anyway, I'm having a bit of trouble with something. People will be logged in to my game, and then AFK for like 20 minutes, and come back and they are disconnected. I was wondering if there was a way to just *implement* a way to return them to the page they were previously on when they log back in.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Well ... you need to store the last page somewhere. In a cookie would probably be best or a database record associated with the user account.
(#10850)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

You could also go about increasing the session.gc_max_lifetime
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Post by Mightywayne »

arborint wrote:Well ... you need to store the last page somewhere. In a cookie would probably be best or a database record associated with the user account.
In a... cookie...? So that means every page, I'd have to set a cookie. Is that hard on the server or anything?

Edit: Oi, and then, I'd have to set it up on every single file I have, manually, huh? Not too worried, just asking.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

This is one of those arguments for databases session handling as opposed to native sessions. You could always use both. Since you know who they are when they log in, and since you are setting sessions details on every page, you may as well capture what page they are on for every request. The last known page can then be easily fetched when they log back in.
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Post by Mightywayne »

Alright, thanks.
Post Reply