// Test pour prendre le nombre total de joueur et le nombre de joueurs connect�s
if (isset($_GET['ucount']) && $_GET['ucount'] == 1) {
$page = $PlayersOnline['onlinenow']."/".$Count['players'];
die ( $page );
} else {
display($page, $lang['Login']);
}
}
But it only adds a session id which goes away after a short time or if you close the browser, I need to add a cookie that lasts a long time so when they reopen the browser it take them to the right page.
Posted on daniweb but no one is helping so i thought id try here
But it only adds a session id which goes away after a short time ....
a snipper from abstract class User, notice how you can configure the GC probability, the session lifetime and cookie lifetime. Without defining how you want your sessions to behave, PHP will use a default time (something like 21 minutes) which can be incredibly annoying.
PHP Code:
Abstract class User { private static $session = false;
/** * Starts the session with the configuration specified in the CONFIG class. * @return (bool) True if the session started, otherwise false. */ final public static function session_begin() { DEBUG::SANITY("Attempting to start/restart a session"); if(self::$session) { DEBUG::SANITY("The session has already started"); return self::$session === TRUE; // continuing will raise an error. } else { session_save_path(CONFIG::SESSION_SAVE_PATH); ini_set('session.name', CONFIG::SESSION_NAME); ini_set('session.gc_probability', CONFIG::SESSION_GC_PROBABILITY); ini_set('session.gc_maxlifetime', CONFIG::SESSION_GC_MAX_LIFETIME); ini_set('session.cookie_lifetime', CONFIG::SESSION_COOKIE_LIFETIME); ini_set('session.cache_expire', CONFIG::SESSION_CACHE_EXPIRE); } self::$session = session_start(); DEBUG::SANITY(self::$session ? "Session has started." : "Session failed to start!"); return (bool) self::$session; }
}
I use (, ; : -) as I please- instead of learning the English language specification: I decided to learn Scheme and Java;
Bookmarks