Copied to clipboard

Flag this post as spam?

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


  • Bunnynut 136 posts 318 karma points
    Mar 18, 2014 @ 22:30
    Bunnynut
    0

    Member.GetCurrentMember() is alyways null

    Hello everyone,

    I have a website running Umbraco v 4.0.4.1 which was running fine until a few days ago.
    The problem is that logging in, using the umbracomembershipprovider, works but when i use Member.GetCurrentmember() it always returns null.

    This website has been running for several years now and suddenly this problem came up.

    Another funny things is that this issue only arises in the dev and staging environment, but not (luckily) in production environment. I have compared the web.configs but i see no differences between them.

    Is there anyone who can help me with this issue?

    Thanks in advance.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 18, 2014 @ 22:35
    Jan Skovgaard
    0

    Hi Bunnynut

    That's an odd issue - Has something changed in dev/staging? Server setup, server upgrades, MSSQL changes? Code changes interacting with the API?

    Does the Log table reveal any usefull information from that date where things started acting weird?

    /Jan

  • Bunnynut 136 posts 318 karma points
    Mar 18, 2014 @ 22:51
    Bunnynut
    0

    Hi Jan,

    I have checked the log table, but there is nothing of interest there.

    I have had a problem with postback always being false which was caused because i had some controls that used a postbackurl.
    But no changes to the actual logging in or other membership related functions.

     

  • Bunnynut 136 posts 318 karma points
    Mar 19, 2014 @ 09:45
    Bunnynut
    0

    When i logging in i use the following code to check the credentials:
    Member m = Member.GetMemberFromLoginNameAndPassword(txtEmail.Text, txtPassword.Text);
    This works. So i have a member. Next i put the member in cache:
    Member.AddMemberToCache(m);
    With the memberID i fetch any shoppingdata stored in the database, works fine and consistent through the rest of the visit.

    But the the funny thing is that in my navigation i show some links when a user is logged in a member cannot be found. 

    The following code always returns false: System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
    and Member.GetCurrentMember alwyas returns null.

     

  • Charles Afford 1163 posts 1709 karma points
    Mar 20, 2014 @ 21:31
    Charles Afford
    0

    Have you got the correct access set in IIS?  Go to your site in IIS, click Authentication.  Have you got forms auth turned on?  I am assuming the session is not being set when you login?

    Have you looked at the request in fiddler?

    Charlie

     

  • Bunnynut 136 posts 318 karma points
    Mar 24, 2014 @ 12:06
    Bunnynut
    0

    I wasnt able to reply sooner sorry. This all related to an issue caused by the usage of the PostbackURL property in a LinkButton control.

    I have a languageswitch usercontrol in the website which has a LinkButton control in it. For some reason when you use PastbackURL IsPostback is always false.

    I get a lot of these weird errors lately.

Please Sign in or register to post replies

Write your reply to:

Draft