Copied to clipboard

Flag this post as spam?

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


  • DennisA 1 post 71 karma points
    Nov 05, 2018 @ 15:35
    DennisA
    0

    User and member logged into same session problematic

    Hi there,

    I'm quite new to Umbraco. My customer asked me to take over a webshop which is based on uWebshop. Unfortunately, uWebshop hasn't been tested on Umbraco versions 7.2.8+ as it's end of life. Will try to update Umbraco in a local environment soon, as we're also not getting security patches now.

    One thing that's currently problematic in the webshop is the following: I can't be logged into the Umbraco backoffice (user) and the webshop frontend (member) at the same time.

    Part of the webshop frontend is checking if the customer is logged in (member):

    public static bool isLoggedInCustomer()
        {
            bool retBool = false;
            MembershipHelper membershipHelper = new MembershipHelper(UmbracoContext.Current);
            if (membershipHelper.IsLoggedIn())
            {
                var member = membershipHelper.GetCurrentMember();
                if (member != null)
                {
                    retBool = member.DocumentTypeAlias.ToLower().Equals("customers");
                }
            }
            return retBool;
        }
    

    However, when I'm logged in both as a user and a member (different accounts), membershipHelper.IsLoggedIn() returns false. In the frontend it then looks like the member isn't logged in.

    When I log out of the Umbraco backoffice, membershipHelper.IsLoggedIn() returns true again.

    I'm not sure whether this is a known issue, and it might be solved in a more recent version of Umbraco already. The only similar things I could find were this forum post (0 replies) and this issue (closed due to inactivity).

    Members are logged into the frontend as follows:

    FormsAuthentication.SetAuthCookie(userNameValue, true);
    

    If anyone could help out a bit here, or point me to the right direction, that'd be great!

    Thanks, Dennis

Please Sign in or register to post replies

Write your reply to:

Draft