Also, because my brain works wrongly, I added the "pre" tag to the list of approved HTML tags. There isn't a button... so you have to look at the code... to get the pre tag. Ha... ha... ha.

ini_set("session.gc_maxlifetime", COOKIE_EXPR_TIME );
ini_set("session.save_path", SESS_PATH );
// Get some cookie modifications going
session_name( SESS_NAME );
# $ck = session_get_cookie_params();
# $ck['lifetime'] = $ck['lifetime'] + COOKIE_EXPR_TIME;
session_set_cookie_params( COOKIE_EXPR_TIME, COOKIE_PATH );
session_cache_expire( COOKIE_EXPIRE_TIME / 60 );

// Globally, start or resume current session
session_start();

# We've already got our cookie set.
$is_session_available = false;
if( isset( $_COOKIE[SESS_NAME] ) ) {
    $is_session_available = true;
    setcookie(
        SESS_NAME,
        session_id(),
        time()+COOKIE_EXPR_TIME,
        COOKIE_PATH
    );
}
 

(Actually, it's a little bit unwieldy at the moment. But as I find case to put more code in, I'll see if I can't improve upon it).

#4033, posted at 2012-01-26 16:51:19 in idkfa