Copied to clipboard

Flag this post as spam?

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


  • John Bergman 460 posts 1066 karma points
    Jun 07, 2018 @ 23:10
    John Bergman
    0

    Detecting Member is Logged in

    Anyone seen this circumstance before?

    membershiphelper.IsLoggedIn() returns true, by GetCurrentMemberId() returns -1?

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Jun 19, 2018 @ 14:33
    Alex Skrypnyk
    0

    Hi John

    Did you try?

    Request.IsAuthenticated
    
  • Olly Fray 11 posts 91 karma points
    Jun 20, 2018 @ 12:55
    Olly Fray
    0

    It works as expected for me.

    There may be some cookie problems so I'd suggest clearing everything with the following:

    TempData.Clear();
    Session.Clear();
    FormsAuthentication.SignOut();
    

    And then trying it again.

    You could use the Member Service as a workaround as well and get the user via username:

    var username = Membership.GetUser().UserName;
    var member = memberService.GetByUsername(username);
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies