Chris

Chris

  • NA
  • 1
  • 0

new session id and stay logged in

Apr 19 2010 8:51 PM
Hi all, in my app a user places an order and should be assigned a new session id.

Then they should be able to place a new order using this session id so as not to ovewrite their previous orders data. Unfortunately the only way I can get a new session id is by calling HttpContext.Current.Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", "")); which then logs the user out.

If I call System.Web.Security.FormsAuthentication.SetAuthCookie(username, true); to log the user back in HttpContext.Current.User.Identity.IsAuthenticated == false and so they still have to log in.

Is there a way that I can create a new session and keep the user logged in, or create a new session and then log the user in programmatically without them being redirected?