RedirectFromLoginPage: Returns to login page.

Discussion in 'ASP .Net Security' started by Tim Murphy, Sep 26, 2005.

  1. Tim Murphy

    Tim Murphy Guest

    I'm using the following code in my login.aspx page to validate a user. The
    FormsAuthentication.RedirectFromLoginPage(cUser,bPersistent) gets called but
    login.aspx gets redisplayed instead of returning to the calling page. If I
    change the address line in IE to the calling page I can see the new user has
    been logged.

    I'm using Windows 2000 Pro + ASP.Net 1.1.

    Any ideas what the problem is?

    Tim

    <script language="VB" runat="server">

    Sub ProcessLogin(objSender As Object, objArgs As EventArgs)

    Dim cUser As String
    Dim cPassword As String
    Dim bPersistent As Boolean

    cUser = txtUser.Text
    cPassword = txtPassword.Text
    bPersistent = chkPersistLogin.Checked

    ' This is were I should compare to the database.
    If True Then
    FormsAuthentication.RedirectFromLoginPage(cUser,bPersistent)
    Else
    ErrorMessage.InnerHtml = "<b>Something went wrong...</b> please re-enter
    your credentials..."
    End If

    End Sub

    </script>
    Tim Murphy, Sep 26, 2005
    #1
    1. Advertising

  2. Hello Tim,

    use www.fiddlertool.com to check if the cookie gets transmitted properly
    and if IE sends the cookie on subsequent requests.

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > I'm using the following code in my login.aspx page to validate a user.
    > The FormsAuthentication.RedirectFromLoginPage(cUser,bPersistent) gets
    > called but login.aspx gets redisplayed instead of returning to the
    > calling page. If I change the address line in IE to the calling page I
    > can see the new user has been logged.
    >
    > I'm using Windows 2000 Pro + ASP.Net 1.1.
    >
    > Any ideas what the problem is?
    >
    > Tim
    >
    > <script language="VB" runat="server">
    >
    > Sub ProcessLogin(objSender As Object, objArgs As EventArgs)
    >
    > Dim cUser As String
    > Dim cPassword As String
    > Dim bPersistent As Boolean
    > cUser = txtUser.Text
    > cPassword = txtPassword.Text
    > bPersistent = chkPersistLogin.Checked
    > ' This is were I should compare to the database.
    > If True Then
    > FormsAuthentication.RedirectFromLoginPage(cUser,bPersistent)
    > Else
    > ErrorMessage.InnerHtml = "<b>Something went wrong...</b> please
    > re-enter
    > your credentials..."
    > End If
    > End Sub
    >
    > </script>
    >
    Dominick Baier [DevelopMentor], Sep 26, 2005
    #2
    1. Advertising

  3. Tim Murphy

    Tim Murphy Guest

    One should always sleep on a problem before pulling their hair out.

    The problem was the cookie setting in ZoneAlarm.

    Tim

    "Tim Murphy" <> wrote in message
    news:4337f207$0$13321$...
    > I'm using the following code in my login.aspx page to validate a user. The
    > FormsAuthentication.RedirectFromLoginPage(cUser,bPersistent) gets called

    but
    > login.aspx gets redisplayed instead of returning to the calling page. If I
    > change the address line in IE to the calling page I can see the new user

    has
    > been logged.
    >
    > I'm using Windows 2000 Pro + ASP.Net 1.1.
    >
    > Any ideas what the problem is?
    >
    > Tim
    >
    > <script language="VB" runat="server">
    >
    > Sub ProcessLogin(objSender As Object, objArgs As EventArgs)
    >
    > Dim cUser As String
    > Dim cPassword As String
    > Dim bPersistent As Boolean
    >
    > cUser = txtUser.Text
    > cPassword = txtPassword.Text
    > bPersistent = chkPersistLogin.Checked
    >
    > ' This is were I should compare to the database.
    > If True Then
    > FormsAuthentication.RedirectFromLoginPage(cUser,bPersistent)
    > Else
    > ErrorMessage.InnerHtml = "<b>Something went wrong...</b> please re-enter
    > your credentials..."
    > End If
    >
    > End Sub
    >
    > </script>
    >
    >
    >
    Tim Murphy, Sep 26, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lauchlan M
    Replies:
    2
    Views:
    474
    John Saunders
    Aug 17, 2003
  2. Stephen Miller
    Replies:
    5
    Views:
    9,073
    kaverao
    Sep 17, 2009
  3. Edward Mitchell
    Replies:
    8
    Views:
    1,729
    Steven Cheng[MSFT]
    Feb 22, 2005
  4. Jeremy Chapman
    Replies:
    1
    Views:
    2,953
    ajamrozek
    Sep 21, 2005
  5. Ben Fidge
    Replies:
    3
    Views:
    608
    Mr Newbie
    Nov 6, 2005
Loading...

Share This Page