controllers/AuthController.php
/**
     * Create session and put essential data in session
     *
     * @param array $userDetails
     * @param bool  $shouldRememeber
     * @return bool
     */
Create session and put essential data in session
@param array $userDetails
@param bool  $shouldRememeber
@return bool
Create session and put essential data in session @param array $userDetails @param bool $shouldRememeber @return bool
private function createUserSession(array $userDetails, $shouldRememeber) {
        if ($shouldRememeber) {
            Session::setCookieParams(self::SESSION_COOKIE_LIFETIME, '/');
        }
        if (Session::isExist()) {
            Session::regenerateId(true);
        } else {
            Session::start();
        }
        $userDetails[Users_DBTable::IP_ADDRESS] = $_SERVER['REMOTE_ADDR'];
        $uc = new UserPreferencesController();
        if ($this->getModel()->updateUserLogin($userDetails)) {
            Session::set(self::$SESSION_SITE_IDENTIFIER, self::getEncryptedSiteIdentifier());
            Session::set(self::$AUTH_USER_ID_IDENTIFIER, $userDetails[Users_DBTable::USER_NAME]);
            Session::set(Session::SESS_USER_DETAILS, $userDetails);
            Session::set(Session::SESS_USER_PREF_KEY, $uc->getUserPreference($userDetails[Users_DBTable::USER_ID]));
            return true;
        } else {
            return false;
        }
    }
private function createUserSession ( array $ userDetails , $ shouldRememeber ) { if ( $ shouldRememeber ) { Session :: setCookieParams ( self :: SESSION_COOKIE_LIFETIME , '/' ) ; } if ( Session :: isExist ( ) ) { Session :: regenerateId ( true ) ; } else { Session :: start ( ) ; } $ userDetails [ Users_DBTable :: IP_ADDRESS ] = $ _SERVER [ 'REMOTE_ADDR' ] ; $ uc = new UserPreferencesController ( ) ; if ( $ this -> getModel ( ) -> updateUserLogin ( $ userDetails ) ) { Session :: set ( self :: $ SESSION_SITE_IDENTIFIER , self :: getEncryptedSiteIdentifier ( ) ) ; Session :: set ( self :: $ AUTH_USER_ID_IDENTIFIER , $ userDetails [ Users_DBTable :: USER_NAME ] ) ; Session :: set ( Session :: SESS_USER_DETAILS , $ userDetails ) ; Session :: set ( Session :: SESS_USER_PREF_KEY , $ uc -> getUserPreference ( $ userDetails [ Users_DBTable :: USER_ID ] ) ) ; return true ; } else { return false ; } }
Create session and put essential data in session
 @param array $userDetails
 @param bool  $shouldRememeber
 @return bool
Create session and put essential data in session @param array $userDetails @param bool $shouldRememeber @return bool