Page view counter

login control in IE with host header

Last post 08-06-2007 10:57 PM by Freakyuno. 3 replies.

Sort Posts:

  • login control in IE with host header

    08-03-2007, 4:17 PM
    • Loading...
    • sleekdigital
    • Joined on 06-02-2003, 3:35 PM
    • Posts 28
    • Points 130

    Quick description of the problem...

    In IE the login control is not working when I use a host header to access a site I am developing.

    Longer explaination...

    I'm playing around with the membership provider in ASP.NET 2.0.  So I download the code from the "getting started" video tutorials... http://download.microsoft.com/download/2/3/4/2340602d-ed7b-48b4-a4a1-ba303a5ef296/Membership_CS.msi

    When I access the site as a file system site or using localhost as an http site, the login works fine.  But I like to use host headers so I can access the site by a specific name.  When I set that up the login no longer works in IE.

    I did some investigating with Fiddler and I notice that when I visit the site initially with localhost, a number of cookies are set, including .aspxanonymous.  When I use the my host header, the cookies are not there.  Same goes for the .aspxauth cookie that you normally see during login... I can see the "set cookie" in the response header, but I never see it in subsequent request headers.

    Anyone know what is going on here?  Why would using a host header cause a problem like this?

  • Re: login control in IE with host header

    08-03-2007, 4:29 PM
    • Loading...
    • Freakyuno
    • Joined on 01-20-2005, 4:57 PM
    • Midwest - United States
    • Posts 1,952
    • Points 12,508
    • TrustedFriends-MVPs

    It's actually a pissy little problem caused by the way the .net 2.0 membership sets up registered users.  At the root of the membership tables is an application table.  Normally, for generic type sites or single domain sites, there's only one application listed, wtih a key.  The "/" application.  What happens, especially if you've modified provider settings at all, is users created through the asp.net admin pages are assigned to the "/directoryname" site, and then when you use host headers, you're back at the "/" site.

    I'd bet dollars to donughts thats whats happening.  Inspect your membership table and I bet under applications you'll see 2.  One will be "/" and one will be something like "/projectname"

  • Re: login control in IE with host header

    08-06-2007, 9:58 PM
    • Loading...
    • sleekdigital
    • Joined on 06-02-2003, 3:35 PM
    • Posts 28
    • Points 130

    Thanks very much for the reply, but I think my problem is something different.  I have had my application name set to "/" from the start, and there is only one entry in the application table.  I do have a little more information to report.  I tested the same code on my home pc, and it worked fine.  My home PC has IE 7, while my work pc has IE 6.  As I mentioned before, it works fine in firefox even on my work pc.  So, it seems to be something specific to IE 6 or maybe some specific security settings related to IE 6 on my work pc.  I tried messing with some cookie related settings, but nothing seemed to work.  Any other ideas?

  • Re: login control in IE with host header

    08-06-2007, 10:57 PM
    Answer
    • Loading...
    • Freakyuno
    • Joined on 01-20-2005, 4:57 PM
    • Midwest - United States
    • Posts 1,952
    • Points 12,508
    • TrustedFriends-MVPs

    Well, if it works in Firefox, but not IE - then it has to be a cookie problem of some sort, so you're headed down the right path.  The next thing I think I'd probably try, is manually setting a cookie from code, and then getting it back on another page - you can determine if thats the hangup.  I think I'd probably add your site to IE's trusted sites as well, and see if that makes any difference.

Page 1 of 1 (4 items)