title: ASP.NET How to Use SESSION and Cookies together?
body: <p>I want to use session object in my web app.I want to store some cookies too(Some custom informations) .How can i use both without the URL not being modified like 
  <a href="http://www.example.com/(S(lit3py55t21z5v55vlm25s55))/orderform.aspx" rel="nofollow noreferrer">http://www.example.com/(S(lit3py55t21z5v55vlm25s55))/orderform.aspx</a></p>
  
  <p>In my ASP.NET page,
  I am setting some session variable</p>
  
  <pre><code>Session["customerId"]="Some name";
  </code></pre>
  
  <p>Then i am trying to set some value in cookie</p>
  
  <pre><code>        HttpCookie objCookie = new HttpCookie("vendorName");
          Response.Cookies.Clear();
          Response.Cookies.Add(objCookie);
          objCookie.Values.Add(cookiename, "ATT");
          DateTime dtExpiry = DateTime.Now.AddDays(2);
          Response.Cookies[cookiename].Expires = dtExpiry;
  </code></pre>
  
  <p>In this page now i can access the sesion variable values,But when i m being Redirected to another asp.net page, I am not getting my session values there.Its seems like Its being lossed.</p>
  
  <p>Any idea how to solve this. I want both session and cookies</p>