Fix user session storage in multi-tenancy mode

This commit is contained in:
Albert Santoni 2014-06-23 15:22:44 -04:00
parent f573257dc6
commit a2bef67d33
3 changed files with 20 additions and 9 deletions

View file

@ -101,4 +101,13 @@ class Application_Model_Auth
return $string;
}
/** It is essential to do this before interacting with Zend_Auth otherwise sessions could be shared between
* different copies of Airtime on the same webserver. This essentially pins this session to this hostname and client ID.
* @param Zend_Auth $auth Get this with Zend_Auth::getInstance().
*/
public static function pinSessionToClient($auth)
{
$auth->setStorage(new Zend_Auth_Storage_Session('Airtime' . $_SERVER['SERVER_NAME'] . Application_Model_Preference::GetClientId()));
}
}