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 481 posts 1120 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 (skrypnyk.dev) 6067 posts 23321 karma points MVP 6x admin c-trib
    Jun 19, 2018 @ 14:33
    Alex Skrypnyk (skrypnyk.dev)
    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);
    
Please Sign in or register to post replies

Write your reply to:

Draft