Response redirect Doesnt Work

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Response redirect Doesnt Work

    Why oh why doesnt this work???


    I have a simple forms authentication that all works fine, ie it validates
    user details against a db.

    When i try to redirect it goes off to nowhere.

    eg - code snippet:

    FormsAuthentication.SetAuthCookie(dat("USER_ID"), AutoLogin.Checked)
    Context.Response.Redirect("index.aspx")
    'and tried just Response.Redirect("index.aspx")

    Both of which look like they are going off somewhere, but never reach the
    desired page. I have also tried the following within the <HTML> tag, but
    still the same result?

    if User.Identity.IsAuthenticated then
    response.redirect("index.aspx")
    end if


    This is driving me totally nuts!

    Hope someone can help.




    dave Guest

  2. Similar Questions and Discussions

    1. redirect to guest if first redirect is doesnt work for a user
      Hi all, I was wondering if anyone could help me solve a problem Once a user hits a certain webpage ..I try to redirect them to another using...
    2. Response.buffer doesnt work
      Hello, I am testing buffering an asp page and Flushing information out to the browser, hence i wrote the code in an asp page that follows this...
    3. Response.Redirect doesn't seem to work on NT 4.0 SP6a clients!
      Hi there, I have a web application that recently got redesigned and now makes use of Response.Redirect . The "new" application is hosted on...
    4. Response.Write and Response.Redirect
      On my Page_Load event, i need to do some validation and then either let them proceed, or display a error message and boot them back to the previous...
    5. Redirect to New Browser Window like Response.Redirect
      That worked just fine for me as long as you put that open statement on one line rather than 2. "michel" <michely3k@yahoo.com> wrote in...
  3. #2

    Default Re: Response redirect Doesnt Work

    Have you tried calling Response.End after the redirect? I do it out of
    habit, don't know if it actually makes a dif.

    Randy
    [url]http://www.kbcafe.com[/url]

    "dave" <dave@edin.co.uk> wrote in message news:<#Ts7iTFtDHA.560@TK2MSFTNGP11.phx.gbl>...
    > Why oh why doesnt this work???
    >
    >
    > I have a simple forms authentication that all works fine, ie it validates
    > user details against a db.
    >
    > When i try to redirect it goes off to nowhere.
    >
    > eg - code snippet:
    >
    > FormsAuthentication.SetAuthCookie(dat("USER_ID"), AutoLogin.Checked)
    > Context.Response.Redirect("index.aspx")
    > 'and tried just Response.Redirect("index.aspx")
    >
    > Both of which look like they are going off somewhere, but never reach the
    > desired page. I have also tried the following within the <HTML> tag, but
    > still the same result?
    >
    > if User.Identity.IsAuthenticated then
    > response.redirect("index.aspx")
    > end if
    >
    >
    > This is driving me totally nuts!
    >
    > Hope someone can help.
    Randy Charles Morin Guest

  4. #3

    Default Re: Response redirect Doesnt Work

    This problem is driving me nuts too!!

    Response.End does not work either. :0(

    I've seen some strange things happen. I do have a version that works...

    But when I use a web service to authenticate (called when submitting
    username and password), the call to:

    Response.Redirect(
    FormsAuthentication.GetRedirectUrl(txtUserName.Tex t,
    false));

    does not work, but just loops on the login page.

    Is there anyone that knows why?


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Raj Lealh Guest

  5. #4

    Default Re: Response redirect Doesnt Work

    FOUND IT!

    The reason in my case was SmartNavigation="True" was set at the top of the
    login.aspx page - soon as i removed it - it starting working.

    Hope this helps others......




    "Raj Lealh" <rlealh@utnet.utoledo.edu> wrote in message
    news:uOyt7gdtDHA.2932@TK2MSFTNGP11.phx.gbl...
    > This problem is driving me nuts too!!
    >
    > Response.End does not work either. :0(
    >
    > I've seen some strange things happen. I do have a version that works...
    >
    > But when I use a web service to authenticate (called when submitting
    > username and password), the call to:
    >
    > Response.Redirect(
    > FormsAuthentication.GetRedirectUrl(txtUserName.Tex t,
    > false));
    >
    > does not work, but just loops on the login page.
    >
    > Is there anyone that knows why?
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    dave Guest

  6. #5

    Default Re: Response redirect Doesnt Work

    I found the problem was due to the size of the cookie (> 4.0 KB)

    I was trying to populate the cookie with group names retrieved from
    parsing through Windows 2000 Active Directory. The size of the output
    (xml) was too big, just over 4.0 kb, since I retrieved all nested groups
    that the user belonged to.

    I ended up implementing forms authentication without cookies, and now it
    works fine. You just have to put in a few extra measures to deal with
    security of the mangled URL... ;o)

    example of mangled url (contains session id in brackets):

    [url]http://myserver.edu/(weQWerw34534532456)/admin.aspx[/url]

    Interesting.. eh?

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Raj Lealh Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139