title: Is there a way to use session for objects in asp.net core like in web forms?
body: <p>I have a project in web forms and I am trying to convert it into asp.net core. My problem is that in web forms I save an object to the session and when I get it I can make changes on it and it keeps them. On the other hand, in core I set the object to the session by serializing it. When I get it and make changes it doesn't affect the object stored in the session. Is there a way to save the object as it is (without serializing it), so when I get it from the session and make changes on it, to continue using it and don't have to set it in the session again? </p>
  
  <p>The session was</p>
  
  <pre><code> System.Web.HttpContext.Current.Session["object"]
  </code></pre>
  
  <p>And made it </p>
  
  <pre><code>AppHttpContext.Current.Session.GetString("object") 
  </code></pre>
  
  <p>And then i deserialized it to the object i want.</p>
  
  <p>Ps: I used AppHttpContext to get the session outside of a controller</p>