Problem with redirects or sessions
-
Hi I created my site in asp.net 1.1 It has been running for quite a while now. However, recently, I have started having problems with it. First, I was have a 'Unable to validate data' problem. I resolved this issue by adding the following to my web.config file: enableSessionState="true" enableViewState="true" enableViewStateMac="false" /> However, I am having another strange problem. I have a secure page (Web_page.aspx) and requires the user to be logged in to the site. I perform this check with the following code in web_page.aspx: if(!Context.User.Identity.IsAuthenticated) { Response.Redirect("login_page.aspx"); } else { continue with the page} The problem is that: If a person is logged in and he clicks on the web_page.aspx link, the system redirects them to login.aspx page (the system should take them to the web_page.aspx page because the user is already logged in). At this if the user clicks on web_page.aspx link AGAIN, then it works correctly, i.e. I am taken to web_page.aspx. As you can see, I have to click TWICE on this link to make it work correctly. This is happening with ALL the pages that require login. Very strange indeed. Any idea what is happening here? My system was working correctly in the past. This problem has just emerged.
-
Hi I created my site in asp.net 1.1 It has been running for quite a while now. However, recently, I have started having problems with it. First, I was have a 'Unable to validate data' problem. I resolved this issue by adding the following to my web.config file: enableSessionState="true" enableViewState="true" enableViewStateMac="false" /> However, I am having another strange problem. I have a secure page (Web_page.aspx) and requires the user to be logged in to the site. I perform this check with the following code in web_page.aspx: if(!Context.User.Identity.IsAuthenticated) { Response.Redirect("login_page.aspx"); } else { continue with the page} The problem is that: If a person is logged in and he clicks on the web_page.aspx link, the system redirects them to login.aspx page (the system should take them to the web_page.aspx page because the user is already logged in). At this if the user clicks on web_page.aspx link AGAIN, then it works correctly, i.e. I am taken to web_page.aspx. As you can see, I have to click TWICE on this link to make it work correctly. This is happening with ALL the pages that require login. Very strange indeed. Any idea what is happening here? My system was working correctly in the past. This problem has just emerged.
What kind of Authentication you are using. Are you using some custom one or soem built in ASP.NET like Froms etc? Cheers, Ashik
-
What kind of Authentication you are using. Are you using some custom one or soem built in ASP.NET like Froms etc? Cheers, Ashik
To me , it does not seem like a authentication or session expiration problem. The users are still logged in when they click on the link twice. It seems more like a caching problem on the client side
-
To me , it does not seem like a authentication or session expiration problem. The users are still logged in when they click on the link twice. It seems more like a caching problem on the client side
Have u first time checked the condition in the page load event when it redirects to login page? Does the IsAuthenticated come False ? Ashik