Copied to clipboard

Flag this post as spam?

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


  • Thor Østergaard 37 posts 58 karma points
    Oct 10, 2011 @ 07:23
    Thor Østergaard
    0

    Member.GetCurrentMember().Id getting the wrong member

    Hi,
    I'm on 4.7.0. Having a simple asp.net login control letting members login.

    And in a usercontrol I try to get the ID of the member logged in with the Member.GetCurrentMember().Id but in Chrome and FF I get the ID of another member :(
    It works as expected in IE.

    It's properly a cache issue, but I can't ask my members to clear their cache each time a new member wants to log in from the same computer. And it would be nice to be able to trust the ID I get from the GetCurrentMember method...

     

  • Thor Østergaard 37 posts 58 karma points
    Oct 10, 2011 @ 07:29
    Thor Østergaard
    0

    Using HttpContext.Current.User.Identity.Name I'm getting the right username!

  • Rodion Novoselov 694 posts 859 karma points
    Oct 10, 2011 @ 07:33
    Rodion Novoselov
    0

    Hi. Are your sure that it's the Member.GetCurrentMember().Id to blame? It's a method of the server-side API - it's hardly possible that it could be anyway affected by the client-side cache. How does it show up in your case that the current member id doesn't change? (I mean - is it visible in some page element or like this?)

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 10, 2011 @ 07:35
    Fuji Kusaka
    0

    Hi,

    You might be having this big in version v4.70 where when logging out it doesn't completely log the user out. Check this bug , is this fixed in v 4.7.1.

    What you can also do is to create a Logout button in a C# usercontrol to completely logout the user.

    /fuji

  • Thor Østergaard 37 posts 58 karma points
    Oct 10, 2011 @ 07:36
    Thor Østergaard
    0

    Well.. 
    I'm just guessing.

    I show the member id in a label on my usercontrol like his:

    lblUserinfo.Text += "<br/>Umbraco userid: " + Member.GetCurrentMember().Id.ToString() 

  • Thor Østergaard 37 posts 58 karma points
    Oct 10, 2011 @ 07:37
    Thor Østergaard
    0

    @fuji: don't I get logged out when closing the browser?

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Oct 10, 2011 @ 07:40
    Markus Johansson
    0

    Are you running v 4.7.0? There was some major bugs in that version, try upgradigt to v 4.7.1! You can download it from codeplex http://umbraco.codeplex.com/

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 10, 2011 @ 07:40
    Fuji Kusaka
    0

    No you dont since the caching is till here.....try clearing your cache completely and check the difference.

    I had the same issue, where i was to display member Name. 

  • Rodion Novoselov 694 posts 859 karma points
    Oct 10, 2011 @ 07:43
    Rodion Novoselov
    0

    Try to temporarily add sort of a timestamp to the lblUserinfo.Text, like:

    lblUserinfo.Text += "<br/>Umbraco userid: " + Member.GetCurrentMember().Id.ToString()  + " " + DateTime.Now.ToString();

    At least you will find out whether it has something to do with the cache.

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 10, 2011 @ 07:44
    Fuji Kusaka
    0

    But you will have to either upgrade to version 4.7.1 or try have a look at uLogin, and add some code to completely logout user.

  • Thor Østergaard 37 posts 58 karma points
    Oct 10, 2011 @ 07:46
    Thor Østergaard
    0

    I think I will go for the upgade and let you know the outcome of that :)

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 10, 2011 @ 07:49
    Fuji Kusaka
    0

    Ok let us know how its handling it. 

     

  • Thor Østergaard 37 posts 58 karma points
    Oct 12, 2011 @ 12:30
    Thor Østergaard
    0

    Have updated to 4.7.1 and the problem seems to be solved by the upgrade :)

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 12, 2011 @ 12:33
    Fuji Kusaka
    0

    Hi Thor,

    Great if you got it working when upgrading to v4.7.1.

    //fuji

Please Sign in or register to post replies

Write your reply to:

Draft