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...
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?)
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.
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/
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...
Using HttpContext.Current.User.Identity.Name I'm getting the right username!
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?)
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
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()
@fuji: don't I get logged out when closing the browser?
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/
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.
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.
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.
I think I will go for the upgade and let you know the outcome of that :)
Ok let us know how its handling it.
Have updated to 4.7.1 and the problem seems to be solved by the upgrade :)
Hi Thor,
Great if you got it working when upgrading to v4.7.1.
//fuji
is working on a reply...