I have a login form with two boxes and button on buttonclick I validate user using sql database and store the id in session and set up FormsAuthentication for later use. on logout button I redirect them logout.aspx where i destroy the session and redirect to login page :
Session.Abandon();
FormsAuthentication.SignOut();
now after logout if i go back using browser back button, I still can see my previouse page but if I refresh I get object reference not set to an instance of an object.
protected void Page_Load(object sender, EventArgs e)
Line 33: {
Line 34: string id = Session["ID"].ToString();
What is the best work around for this to send user back to login if this happens?
