0

We have ASP.NET code that runs fine on Windows 2008, but on Windows 2012 (on an Azure VM) it's deleting the session variables on a redirect:

Login loggedInUser = StoreV2Entities.Current().Logins.Include(a => a.Account).SingleOrDefault(l => l.UserName == UsernameTextbox.Text);
Session["login"] = loggedInUser;
Response.Redirect("~/apps/UserCart.aspx?register=1", false);

Is there some way to make this work?

And if not, what is the best way to persist session variables? This is on an Azure VM but it's not an Azure website, it's a plain old Windows 2012 VM. No clustering or fail over or publishing to a changing system.

thanks - dave

David Thielen
  • 28,723
  • 34
  • 119
  • 193
  • I think rather than doing it this way, you may want to create a form authentication auth ticket and let asp.net handle your user authentication issues. Someone already answered it here as how can you create a auth ticket and set in cookie. http://stackoverflow.com/questions/7217105/asp-net-how-can-i-manually-create-a-authentication-cookie-instead-of-the-defau But the issue you are facing is an interesting one, I will keep digging on that :) – qamar Jan 08 '15 at 03:45
  • @qamar our problem is we store more than just the login in the Session. If we can no longer do that we're looking at a couple of days programming and more testing. TIA – David Thielen Jan 08 '15 at 03:47
  • Then may be you can try storing in cookies. – qamar Jan 08 '15 at 03:49

0 Answers0