I am assuming that this above would go into the login file that processes the login and starts the session?
I have the code below in my log in file. Yes, I am a cut and paste coder :)
Does this mean it should work across subdomains since it says it's persistent sessions?
@session_start();
$usersession = generate_session(100);
$host_name = '.'.str_replace('www.','',$_SERVER['HTTP_HOST']);
if($_POST['persistent'] == 'yes'){
setcookie("usersession", $usersession, time()+ ($_POST['persistentFor']*7*24*60*60), "/", $host_name, 0);
}
$_SESSION['usersession'] = $usersession;
$user_ip = get_ip();
$insert_session = @mysql_query("INSERT INTO `memb_usersessions`
(`session_id`,`user_id`,`session_date`) VALUES ('$usersession','$get_user[user_id]',NOW())");