Copied to clipboard

Flag this post as spam?

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


  • Giovanni Sidoel 94 posts 233 karma points
    Sep 08, 2015 @ 19:30
    Giovanni Sidoel
    0

    Logging a member in after changing his login

    Hello,

    I've created a profile page in which a member can update their info. However when a member changes their email (which we use as login), this user is immediately logged out and has to log in again with the new email.

    How can I log this member in programmatically?

    Members.Login(<username>, <password>) 
    

    won't work in this instance as I cannot retrieve the plain text version of the password. When creating a member you get this from you form. In this case it's an existing user.

    Help much appreciated.

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 9x admin c-trib
    Sep 09, 2015 @ 08:37
    Alex Skrypnyk
    101

    Hi Giovanni,

    What authentication method are you using ? If it's Forms you have to add new auth Cookies for username.

    FormsAuthentication.SetAuthCookie(username, true);
    

    Thanks, Alex

  • Giovanni Sidoel 94 posts 233 karma points
    Sep 09, 2015 @ 11:35
    Giovanni Sidoel
    0

    Thanks very much Alex. it works!

  • 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