How to log a user out by code? + asp.net membership
I am not using the loginview control since it just caused me too many problems so I am just making my own. Basically right now I have a hyperlink and on every aspx page I have on page_load checking if the user is logged in or not.
If the user is logged in then I just change the hyperlink to say logout and change the path to the logout.aspx file. If they are authenicated then I just make sure it says login and the path points to the login.aspx.
Now on my logout.aspx file in the page load I have
Now I have some stuff in a loginView control and I noticed that even though the persons been signed out they still see the menu items as if they where still logged in. If I refresh though they go always.
So what am I missing to make these go away? Am I not full logged out at this time?