Copied to clipboard

Flag this post as spam?

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


  • Ryuu 9 posts 39 karma points
    Apr 08, 2015 @ 15:27
    Ryuu
    0

    Log a member in programmatically

    Hi all

    After retrieving a member using Members.GetById(), is it possible to set this as the current logged in member?

    Thanks in advance

  • Sören Deger 733 posts 2844 karma points c-trib
    Apr 08, 2015 @ 15:34
    Sören Deger
    0

    Hi Ryuu,

    you can use this:

    MembershipHelper Members = new MembershipHelper(UmbracoContext.Current);

    if(Members.Login(username, password))
    {
       
    // success: do anything
    }  

     

    Best,

    Sören

  • Ryuu 9 posts 39 karma points
    Apr 08, 2015 @ 15:36
    Ryuu
    0

    Hi Sören

    Thanks for the quick reply, but I don't have the member password at this point (it doesn't appear to be available on Member object I just retrieved)

    I'm trying to set the retrieved member as the currently logged in one

  • Alejandro Ocampo 67 posts 330 karma points c-trib
    Apr 13, 2015 @ 13:40
    Alejandro Ocampo
    100
  • Ryuu 9 posts 39 karma points
    May 06, 2015 @ 11:03
    Ryuu
    0

    Ale you legend! Exactly what I was looking for, thank you. :)

    Surprised I never came across that thread as I spent quite a bit of time furiously googling. Ah well

  • 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