title: MVC C# Best approach - session variable
body: <p>I have a Details and Edit page from where the user can send out an email by clicking on a email hyperlink.</p>
  
  <p>When they click on the Details or Edit page hyperlink, I go to the controller which opens up an email that the user can edit.</p>
  
  <p>On submit of the email, I go to the [httppost].</p>
  
  <p>On the httppost actionresult, I need to use the return RedirectToAction in order to redirect the user back to either the Edit or Details page from where they started from.</p>
  
  <p>I was thinking of keeping this information in a session variable as to where the user originated from: </p>
  
  <pre><code>   Session["Originated"] = "Edit";
  </code></pre>
  
  <p>or </p>
  
  <pre><code>   Session["Originated"] = "Details";
  </code></pre>
  
  <p>Or is there a better way to keep track of this.</p>