c# - Session login not logging out on button click -


i have site stores variables on user login, db. 1 such variable (on successful login) sitesession.current.isloggedin = true.

when click logout button, method tells set false, proceed session.clear() , session.abandon().

up now, have click logout button twice before changes made.
tested response.write(sitesession.current.isloggedin); in logout() method.

the first click doesnt show anything, second click shows false.

could tell me i;m going wrong?

/// <summary> /// logs user out, , destroys session /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lnkaccountlogout_click(object sender, eventargs e) {     sitesession.current.isloggedin = false;     sitesession.current.rollid = "-1";      session.clear();     session.abandon();     response.write(sitesession.current.isloggedin); } 

~ login opposite that, whilest storing few more variables.

edit: if reload page after click first time, nothing happens.

it may cost time store changes in db. try let run in thread , let thread wait till isloggedin true.

i hope helps =)


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -