Updated Session::authenticate method