function sessionSync(cfid,cftoken,fuse,session,userString)
{
	var persistantOptions={hoursToLive:262974}; //30 years
	$.cookies.set('CFID', cfid, persistantOptions);
	$.cookies.set('CFTOKEN', cftoken, persistantOptions);
	$.cookies.set('FUSE', fuse);
	if(session){
		$.cookies.set('SESSION', session);
	} 
	globalUser=JSON.parse(userString);
}

function ensureSyncWith(masterSessionUrl)
{
	if (typeof(customSessionSync)!="undefined")
	{ 
		customSessionSync();
	} else if ($.cookies.test()) {
		retrieveMasterSession(masterSessionUrl);
	}
}

function retrieveMasterSession(masterSessionUrl)
{
	window.location=masterSessionUrl;
}