Copied to clipboard

Flag this post as spam?

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


  • Andrew Blyth 4 posts 24 karma points
    Nov 12, 2013 @ 15:12
    Andrew Blyth
    0

    Membership login maintained across multiple sites

    Hi All, 

    Is there a way to maintain a member login / cookie between sites?

    So if I logged in as a member on www.site1.local and the clicked a link on www.site1.local which took me through to www.site2.local (both running on the same umbraco instance) I would still be logged in on www.site2.local?

    Many thanks in advance

     

    Technical Dogsbody

  • Chris Randle 67 posts 181 karma points c-trib
    Nov 13, 2013 @ 14:18
    Chris Randle
    0

    Hi

    In .NET you can maintain session through the use of a database. If both sites use this database then yes, the session should be maintained. Assuming both sites are running from the same installation of Umbraco, then the login would be maintained. 

    This is standard ASP.NET session management though. You basically switch from In Process to either database or state server and then you can have single sign in by securely passing the email address from site 1 and then logging in as the user with that email address on site 2.

    You would create an instance of the member as follows:

    Member theMember = Member.GetMemberFromEmail(Session["email"]); 

    Finally, use Member.AddToCache(theMember) and then use umbraco.library.IsLoggedIn() to check if it works.

    See here for more details.

    Hope this helps.

    - Chris Randle

     

  • Graeme W 113 posts 289 karma points
    Dec 04, 2013 @ 15:44
    Graeme W
    0

    Andrew. I have recently achieved single sign on between an asp.net website and an Umbraco installation that was configured to use that website's membership.

    Presuming your 2 sites are using the same membership database and are on the same web server you should be almost there.

    So that www.site1.local will know you are already logged into www.site2.local and not prompt you to log in again, the trick is to use the same application name in the web.config file in the places where the forms authentication and membership settings are declared. This works as both sites will be looking for the same forms authentication ticket on the client pc.

    That worked for me anyway

Please Sign in or register to post replies

Write your reply to:

Draft