public function loadmeAction(Request $request) { $user = new User(); $user->load($request->getSession()->get('userId')); return new Response(json_encode($user->getData())); }