asp.net - FormsAuthentication.RedirectFromLoginPage Vs Response.Redirect -


this reference question asked here login user after signup , here formsauthentication.redirectfromloginpage reload page.

though have answered first question admit it's "programming co-incidence". if see, answers above 2 questions contradict each other still both worked respective users.

i know exact difference between this

formsauthentication.setauthcookie(user_name, true);  response.redirect("copypastpage.aspx");  

and formsauthentication.redirectfromloginpage(mainsignup.username, true);

in terms of usage, can see logical difference response.redirect can allow redirecting url against redirectfromloginpage redirect referrer. that's usage difference.

is there fundamental diffence in way of execution? if not, thoughts why 1 work @ times , why other @ times? happens under hood of each of them?

i have google bit not concrete answer.

if @ code in redirectfromloginpage same

  • setauthcookie
  • get return url query string
  • clear return url

here snippet:

    httpcontext current = httpcontext.current;     string returnurl = getreturnurl(true);     if (cookiessupported || ispathwithinapproot(current, returnurl))     {         setauthcookie(username, createpersistentcookie, strcookiepath);         returnurl = removequerystringvariablefromurl(returnurl, formscookiename);         if (!cookiessupported)         {             int index = returnurl.indexof("://", stringcomparison.ordinal);             if (index > 0)             {                 index = returnurl.indexof('/', index + 3);                 if (index > 0)                 {                     returnurl = returnurl.substring(index);                 }             }         } 

but check support cookie.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -