Home » .Net Framework

httpcontext.current.user.identity.isauthenticated always false


please help me, I create two pages, the first one is the login page with user name and password textboxes - (not asp login control) , when clicking login button I check the login authentication, if it is true redirect to default page. in the default page if !IsCallBack then i check httpcontext.current.user.identity.isauthenticated

if it is false i redirect the user to the login page. but my problem is that the httpcontext.current.user.identity.isauthenticated is always false.

Below the section of authentication in web config



authenticationmode="Forms">formsloginUrl ="FrmUserLogin.aspx"


protection ="All"


timeout ="1"


name ="LoginRedirectCallback"


path ="/LoginRedirectCallback"


requireSSL ="false"


slidingExpiration ="true"


defaultUrl ="FrmDBLoginConfigaspx.aspx"


cookieless ="UseDeviceProfile"








enableCrossAppRedirects ="false">credentialspasswordFormat="Clear">username ="admin"password ="admin"/>credentials>forms>authentication>

thank you for any help.


Best Regards,


5 Answers Found


Answer 2

Are you using FormsAuthentication.Authenticate method? 


Answer 3

Thank you for your help. yes I use  FormsAuthentication.Authenticate, do you have any suggestions?


Answer 4


You will have to use FormsAuthentication.SetAuthCookie() method with Authenticate method

check this sample: http://www.codeproject.com/KB/aspnet/custom_authentication.aspx



Answer 5

Thank you sanjibsinha.

 Your link was very useful for me. again thank you for your help. 



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure