object get_session_cookie(object request)
Cookie get_session_cookie(Request request)
object get_session_cookie(object request){	int expires;	string id;	object cookie, old, session;	if(time() > (last_clean + 5*60)) {		clean();		last_clean = time();	}	old = request->get_cookie( name );	cookie = new_object(HTTP_COOKIE);	expires = time() + get_session_length();	if( !old || !sessions[old->get_value(key)] ) {		id = new_id();		session = new_object(HTTP_SESSION);	} else {		id = old->get_value(key);		session = sessions[id][1];	}    /* Create a session for application */    session->set_id( id );    session->set_expires( expires );    session->set_application( this_object() );	sessions[id] = ({ expires, session });	/* Create a cookie for user-agent */	cookie->set_name(name);	cookie->set_value( key, id );/*	cookie->set_domain(	app->get_hostname() );	cookie->set_max_age( get_session_length() );	cookie->set_expires( datetime(expires, app->get_timezone()) );*/	cookie->set_path("/" );	/* Add breadcrumb */	session->set_breadcrumb(		request->get_uri()->get_relative_path() + 		request->get_uri()->get_filename() 	);	return cookie;}