Hey guys,
New coder here. Been away from it for a few months and even then had minimal experience with asp.net/c#. I'm helping my local gaming community by fixing some of their functionality issues on their website. I've been doing a lot of research and ran lots of tests on the code that I had changed but I just want to scream. So, I came here because I'm confident this problem is not nearly what I'm making it out to be.
Problem: When a person is paying cash the day of the event and has to create a username, the admin has to refresh the table in order for the name to populate in the table so we can select "cash paid". When it gets refreshed, the admin is logged out and has to log back in then the table is also updated so we can select "cash paid".
I feel the authentication cookie should not be cleared but the session one should be. Any advice is much appreciated. Apologies if this is indeed a super easy fix.
New coder here. Been away from it for a few months and even then had minimal experience with asp.net/c#. I'm helping my local gaming community by fixing some of their functionality issues on their website. I've been doing a lot of research and ran lots of tests on the code that I had changed but I just want to scream. So, I came here because I'm confident this problem is not nearly what I'm making it out to be.
Problem: When a person is paying cash the day of the event and has to create a username, the admin has to refresh the table in order for the name to populate in the table so we can select "cash paid". When it gets refreshed, the admin is logged out and has to log back in then the table is also updated so we can select "cash paid".
Code
protected void CheckoutButton_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Session.Abandon();
//Clear Authentication Cookie.
HttpCookie cookie1 = new HttpCookie(FormsAuthentication.FormsCookieName, "");
cookie1.Expires = DateTime.Now.AddYears(-1);
Response.Cookies.Add(cookie1);
// clear session cookie (not necessary for your current problem but i would recommend you do it anyway)
HttpCookie cookie2 = new HttpCookie("ASP.NET_SessionId", "");
cookie2.Expires = DateTime.Now.AddYears(-1);
Response.Cookies.Add(cookie2);
Response.Redirect("~/Checkin.aspx");
//FormsAuthentication.RedirectToLoginPage();
}I feel the authentication cookie should not be cleared but the session one should be. Any advice is much appreciated. Apologies if this is indeed a super easy fix.

