Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

FormsAuthentication.RedirectToLoginPage() problem

$
0
0

hi

since i'm new in web developing, this the first time i'm creating web application using login ...
in my master page i'm checking if user is authenticated:

if (HttpContext.Current.User.Identity.IsAuthenticated)
{
    NavigationMenu.Visible = true;
}
else
{
    NavigationMenu.Visible = false;
    FormsAuthentication.RedirectToLoginPage();
}

login page is set in web.config:

<authentication mode="Forms"><forms loginUrl="~/Login.aspx" timeout="2880" /></authentication>

in Login.aspx.cs i set:

FormsAuthentication.SetAuthCookie(user, false);

so when i start application default page should be redirected to login page but the following error is thrown:

The length of the query string for this request exceeds the configured maxQueryStringLength value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The length of the query string for this request exceeds the configured maxQueryStringLength value.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): The length of the query string for this request exceeds the configured maxQueryStringLength value.]
   System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +9672197
   System.Web.ValidateRequestExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +35
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155


this is the query string (if helpful):

http://localhost:25262/Login.aspx?ReturnUrl=%2fLogin.aspx%3fReturnUrl%3d%252fLogin.aspx%253fReturnUrl%253d%25252fLogin.aspx%25253fReturnUrl%25253d%2525252fLogin.aspx%2525253fReturnUrl%2525253d%252525252fLogin.aspx%252525253fReturnUrl%252525253d%25252525252fLogin.aspx%25252525253fReturnUrl%25252525253d%2525252525252fLogin.aspx%2525252525253fReturnUrl%2525252525253d%252525252525252fLogin.aspx%252525252525253fReturnUrl%252525252525253d%25252525252525252fLogin.aspx%25252525252525253fReturnUrl%25252525252525253d%2525252525252525252fLogin.aspx%2525252525252525253fReturnUrl%2525252525252525253d%252525252525252525252fLogin.aspx%252525252525252525253fReturnUrl%252525252525252525253d%25252525252525252525252fLogin.aspx%25252525252525252525253fReturnUrl%25252525252525252525253d%2525252525252525252525252fLogin.aspx%2525252525252525252525253fReturnUrl%2525252525252525252525253d%252525252525252525252525252fLogin.aspx%252525252525252525252525253fReturnUrl%252525252525252525252525253d%25252525252525252525252525252fLogin.aspx%25252525252525252525252525253fReturnUrl%25252525252525252525252525253d%2525252525252525252525252525252fLogin.aspx%2525252525252525252525252525253fReturnUrl%2525252525252525252525252525253d%252525252525252525252525252525252fLogin.aspx%252525252525252525252525252525253fReturnUrl%252525252525252525252525252525253d%25252525252525252525252525252525252fLogin.aspx%25252525252525252525252525252525253fReturnUrl%25252525252525252525252525252525253d%2525252525252525252525252525252525252fLogin.aspx%2525252525252525252525252525252525253fReturnUrl%2525252525252525252525252525252525253d%252525252525252525252525252525252525252fLogin.aspx%252525252525252525252525252525252525253fReturnUrl%252525252525252525252525252525252525253d%25252525252525252525252525252525252525252fLogin.aspx%25252525252525252525252525252525252525253fReturnUrl%25252525252525252525252525252525252525253d%2525252525252525252525252525252525252525252fLogin.aspx%2525252525252525252525252525252525252525253fReturnUrl%2525252525252525252525252525252525252525253d%252525252525252525252525252525252525252525252fdefault.aspx%252525252525252525252525252525252525252525253f

so, i must be doing something wrong ...

please any suggestion how to solve this problem

thanks


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>