Copied to clipboard

Flag this post as spam?

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


  • Martin Sørensen 12 posts 32 karma points
    Aug 30, 2011 @ 13:13
    Martin Sørensen
    0

    Member login persisting between sessions

    Hi all,

    I've just created a member area on a new solution running 4.7.0.

    I've created a UserControl for validating and logging in members. The following code is used for the validation process:

     

    if (Membership.ValidateUser(userName, password))
    {
    FormsAuthentication.SetAuthCookie(userName, false);

    }
    In my understanding the "false" part in the code should mean that member state isn't persisted between sessions.

    Have anyone experienced anything similar, or have any thoughts on how to solve the problem?

    Many thanks in advance

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 30, 2011 @ 13:44
    Dirk De Grave
    0

    Martin,

    Can't you use the standard asp.net login controls which have options to control whether authentication cookies is persisted... On the other hand, there's still an issue with using membership logout functionality in umbraco (should be addressed in v4.7.1), seems that user is still logged in, even though you'd login as a different user. 

    nForum's code has a fix for that... (Check the LogoutMember function), you'd need to use that one to make sure members get logged out correctly

    Cheers,

    /Dirk

     

     

  • Martin Sørensen 12 posts 32 karma points
    Aug 30, 2011 @ 13:50
    Martin Sørensen
    0

    Hi Dirk,

    Thanks for your comments.

    The reason for not using the standard .net controls is, that I need complete control over the markup - and as far as I know, that cannot be accomplished with the standard .net login control. And to my understanding the standard .net controls pipe the login call through to the FormsAuthentication anyway - correct me if I'm wrong :-)

    I've already implemented the fix for logging out users correctly - my only concern at the moment is the fact that login state is persisted between sessions - even though I should've handled that by calling the method with the "false" param.

Please Sign in or register to post replies

Write your reply to:

Draft