locked
deleted user should display as "Logged Out" in LoginView RRS feed

  • Question

  • User1280950372 posted

    In a couple of places in my CreateUserWizard, if users cancel the signup process, I redirect them back back to the home page. However, when I do this the LoginView still shows that person as "Logged In," even though in fact they have been deleted. Two questions:

    (1) Is this practice of deleting them (with "Membership.DeleteUser(Profile.UserName)") when they cancel the best one? To me, it seems the logical thing to do since it's the CreateUserWizard, but I wanted to get anyone else's experience with this.

    (2) How do I update the LoginView to not show the deleted user as logged in?

    Thursday, September 11, 2008 8:11 PM

Answers

  • User2130758966 posted

    A few options:

    Set the LoginCreatedUser attribute in the CreateUserWizard to false.

    This stops the new user being logged in after you finish the wizard. Its normally used inside admin interfaces and might not really be what youre looking for because it might be confusing / annoying for the user to login after they create their account.

     

    Force the log out with code.

    When you are calling DeleteUser you can also call the following:

    Session.Abandon();

    FormsAuthentication.SignOut();

     

    Change the page order of the wizard

    The account is made as soon as you complete the signup page of the wizard, so if you have extra steps after that then you can just reorder it so that you collect the data from those pages first and then the last step is to fill out the username / password / email page.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 12, 2008 4:40 AM

All replies

  • User2130758966 posted

    A few options:

    Set the LoginCreatedUser attribute in the CreateUserWizard to false.

    This stops the new user being logged in after you finish the wizard. Its normally used inside admin interfaces and might not really be what youre looking for because it might be confusing / annoying for the user to login after they create their account.

     

    Force the log out with code.

    When you are calling DeleteUser you can also call the following:

    Session.Abandon();

    FormsAuthentication.SignOut();

     

    Change the page order of the wizard

    The account is made as soon as you complete the signup page of the wizard, so if you have extra steps after that then you can just reorder it so that you collect the data from those pages first and then the last step is to fill out the username / password / email page.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 12, 2008 4:40 AM
  • User491671484 posted

    Hi,

     

    You can do it by clearing all the sessions and redirect them to the main page. You can also play with a bit field for the particular user. Set it tru when the user is logged in and set it false when user gets logged out and check the bit if its false then rediredt to another page..

    I think it can work for you.

    Friday, September 12, 2008 5:00 AM
  • User1280950372 posted

    Force the log out with code.

    When you are calling DeleteUser you can also call the following:

    Session.Abandon();

    FormsAuthentication.SignOut();

    The second option, "Force the log out with code", worked for me. At first, I had various CreateUser steps but I decided to consolidate them all into one step, so the third option wouldn't have worked. Thanks for the help! I guess I should put in a warning message when they hit the cancel button.
    Friday, September 12, 2008 12:45 PM