Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Retrieve logged in user is null

Vote:
 

Hi,

I am trying to login a valid user and then retrieve the users information, but gets null value according to the code below:

--------------------------------------------

IUser user; 

SecurityHandler.Instance.AuthenticateUser(LoginUnameBox.Text, LoginPasswBox.Text, out user); //user is ok with correct data

user = CommunitySystem.CurrentContext.DefaultSecurity.CurrentUser;  <----------- Current user is null.

#51081
May 24, 2011 10:23
Vote:
 

I think you have to set the asp.net auth cookie and possibly refresh the page for it to work. If you use the aspnet Login control at least the first part will be handled automatically.

#51099
May 24, 2011 12:48
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.