Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daniel McAteer 13 posts 113 karma points
    1 week ago
    Daniel McAteer
    0

    Membership Provider Login Detection Issue

    I think I'm somehow missing a trick with this, but I can't quite put my finger on what it is, and was hoping someone could point me in the right direction.

    On one of my Umbraco pages, I have a login form, which submits post data to a controller, which then logs the user in using:

    bool authenticated = Members.Login(username, password);
    

    After this point, "authenticated" gets set to true, and the member's "last login date" gets updated with the current timestamp.

    However.. then I assumed for detecting that the user was logged in, I could use one of the following:

    var test_01 = Members.GetCurrentLoginStatus();
    var test_02 = Members.CurrentUserName;
    var test_03 = Members.GetCurrentMember();
    var test_04 = Members.GetCurrentMemberId();
    var test_05 = Members.IsLoggedIn();
    

    but every single one of these fires as if there is no logged in user.

    Little confused as to where I'm going wrong, can anyone lend a hand? :)

  • LeaTark 10 posts 91 karma points
    1 week ago
    LeaTark
    0

    Try

    var test_06 = Members.GetCurrentLoginStatus().IsLoggedIn;
    
  • Daniel McAteer 13 posts 113 karma points
    6 days ago
    Daniel McAteer
    0

    Yeah, I'd checked the properties inside the LoginStatusModel, and unfortunately, that one is false as well :(

  • John Bergman 240 posts 682 karma points
    1 week ago
    John Bergman
    0

    I've also seen cases where IsLoggedIn is true, but GetCurrentMemberId returns -1.

  • Daniel McAteer 13 posts 113 karma points
    5 days ago
    Daniel McAteer
    0

    Ever seen a case where every "logged in" property is false? :p First time I've come across it, and I don't remember having to do any additional config / setup with the other sites I had membership on.

  • Daniel McAteer 13 posts 113 karma points
    5 days ago
    Daniel McAteer
    0

    Anyone got any ideas? :)

Please Sign in or register to post replies

Write your reply to:

Draft