Copied to clipboard

Flag this post as spam?

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


  • Michael Elsgaard 11 posts 28 karma points
    Aug 17, 2009 @ 14:48
    Michael Elsgaard
    0

    Problem with log out of member

    Hey all,

    I have to pages http://testdomain.com/test1 and http://testdomain.com/test2

    test2 is protected so only members of testGroup has access.

    I log in a user using:

    //Get member from email
    Member m = Member.GetMemberFromLoginName("testUser");
    
    //Log member in
    Member.AddMemberToCache(m);
    

    Everything is fine, and user is logged in and can see test2 page

    But when i log a user out using:

    //Log member out
    Member.RemoveMemberFromCache(Member.CurrentMemberId());
    Member.ClearMemberFromClient(Member.CurrentMemberId());

    I can still get to test2 if i type http://testdomain.com/test2 directly in the addressbar.

    Has anyone experienced this problem?

    Thanks..

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Aug 17, 2009 @ 20:48
    Richard Soeteman
    1

    Hi,

    Are you using umbracoV4? If so please use the normal asp.net Login Controls. Then you can use the Following Line to logout the user:

    FormsAuthentication

     

    .SignOut();

    Hope this helps you,

    Richard

  • Michael Elsgaard 11 posts 28 karma points
    Aug 17, 2009 @ 21:13
    Michael Elsgaard
    0

    Thanks for your reply, I should have mentioned that I use umbraco v3.

    The code I'm using to log in/out is taken from here http://umbraco.org/documentation/books/api-cheatsheet/working-with-members

    What is the best way to implement membership in v3?

    thanks...

Please Sign in or register to post replies

Write your reply to:

Draft