Session variable still remains null between two different controllers
I have a problem with my MVC project! The goal is to set a session var in order to pass it to all the controllers: inside my xUserController, Session["UserId"] = 52; Session.Timeout = 30; string SessionUserId = ((Session != null) && (Session["UserId"] != null)) ? Session["UserId"].ToString() : ""; //SessionUserId ="52" But within the ChatMessageController [HttpPost] public ActionResult AddMessageToConference(int? id,ChatMessageModels _model){ var response = new NzilameetingResponse(); string SessionUserId = ((Session != null) && (Session["UserId"] != null)) ? Session["UserId"].ToString() : "";