Forms Authentication issue

msimon7

Member
Joined
Jan 13, 2006
Messages
9
Programming Experience
10+
Hello,
really need some help/suggestions with a Forms Authentication issue
I have a web application in VB.net and using VS 2005, on WinXP

what is happeneing, is that ONLY on my local environment authentication is not taking place correctly
it does not work at all in IE, it kinda works in firefox, it works perfectly with running the site via visual studio debugger

It seems to have been an issue only since i've rebuilt my PC (a guess as this point). the application works fine on our server and other developers PCs, so the code is working, there is just something about my local setup/configuration that we can not figure out.

page flow:

going from the homePage (which is open to the public)

VB.NET:
    <location path="Home.aspx">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>

from there i click on the SignIn.aspx page, after entering usernanme/pswd, it looks up in the database, if valid, the forms auth ticket/cookie is created.

VB.NET:
tkt = New FormsAuthenticationTicket(1, Login.ToUpper, DateTime.Now(), DateTime.Now.AddMinutes(30), True, "FACookie")
    cookiestr = FormsAuthentication.Encrypt(tkt)
    ck = New HttpCookie(FormsAuthentication.FormsCookieName(), cookiestr)

    ck.Path = FormsAuthentication.FormsCookiePath()
    Response.Cookies.Add(ck)

    ' create/populate user session (snipped out to save space)
    
    Response.Redirect(strRedirect, True)  'strRedirect could be one of many destinations after logging in


this is the forms auth setup in web.config

VB.NET:
<authentication mode="Forms">
        <forms name=".ASPXFORMS" loginUrl="SignIn.aspx" protection="All" path="/" timeout="720"/>
    </authentication>
    <authorization>
        <deny users="?"/>
        <allow users="*"/>
    </authorization>

this is where the issue occurs, after clicking the "login" button and then going thru the authentication process.

IE will immediately send me back to signin page, as the ticket/cookie don't exist.
watching the IIS logs via logparser, no cookies are generated.

Firefox will sit there and spin, almost as if it is hung on the redirection. i see in the URL bar it has changed to
the next page. If i hit stop on the browser and then refresh (with the next url still in the url-bar) the page will
load up fine and my session is created and web session authenticated.
I can view the cookies for the session and both the ASPXFORMS cookie and Session_Id cookie are present.

when i run the app via Debugger in visual studio, the site works perfectly fine, using both IE and FF as the debuggers default browser.

I checked out the setting in IIS and under the ASP.NET tab (set to v2.0.50727, by the way),clicking the edit configuration button, Authentication is set to Forms

also in the web.config i have added an impersonate tag to see if that would help any

VB.NET:
<identity impersonate="true" userName="me" password="pswd"/>

(real values for admin account exist in file)


I have search all over the net for days and have tried everything i read about and i'm completely stuck
even when i create a new test web app project, that just has a default page, signin page, page-after-signin
and using hardcoded username/password checks in the codebehind, it still acts the same way as the full application.


any suggestions would truly be appreciated. it is impossible to develop locally currently. I'm at a loss of what to try next or what to look for.

thank you
 
Back
Top