Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms Authentication Not working for more than 2 seconds..

Status
Not open for further replies.

talon121a

MIS
Aug 21, 2003
92
US
Problem is..

Ive enabled forms auth..

web.config piece
Code:
			    <authentication mode="Forms">
					<forms name="WFC1" loginUrl="default.aspx" timeout="120" >
					</forms>
			    </authentication> 
			    <authorization>
			  	 <deny users="?"></deny> 
			    </authorization>

The login process does:

Code:
     If DBAuthenticate(txtUser.Text, txtPass.Text) > 0 Then

       Dim userData As String = session("UserData")

       Dim ticket As New FormsAuthenticationTicket( _
        1, _
        email, _
        System.DateTime.Now, _
        System.DateTime.Now.AddMinutes(30), _
        isPersistent, _
        userData, _
        FormsAuthentication.FormsCookiePath)

       ' Encrypt the ticket.
       Dim encTicket As String = FormsAuthentication.Encrypt(ticket)

       ' Create the cookie.
       Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket))

       ' Redirect back to original URL.
       'Response.Redirect(FormsAuthentication.GetRedirectUrl(email,isPersistent))
       Response.Redirect("/?nav=loggedin")

The problem is..

I can login as any user for like a few seconds. (it brings me to the ?nav=loggedin appropriately showing the users first name from session. (which I set from login process db info). Then when I click around, all within the same page (default.aspx); It forgets me being logged in.. Even if I set the remember me cookie ...


--------
Jason Burton
Leximedia,LLC.
jab@leximedia.net
(im confident with my spam fighting solution)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top