forms authentication issue


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: forms authentication issue

  1. #1
    Join Date
    Dec 2004
    Posts
    12

    forms authentication issue

    Hello,

    Even thought I have my web.config set like this:
    <authentication mode="Forms">
    <forms loginUrl="my_url_here" protection="All" timeout="100" />
    </authentication>

    ... and even though at this help file:
    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconaspnetarchitecture.htm

    ... it confirms that the timeout attribute is in minutes:

    <authentication mode="[Windows|Forms|Passport|None]">
    <forms name="[name]"
    timeout="[minutes]">
    </forms>
    </authentication>

    .... my app session times out after just a few minutes. I see this because it keeps sending me through the auto-logon routine.

    I tried setting the IE security settings higher (to prompt for first and thrid-party cookies being set) and I tried checking and unchecking the checkbox that says "Always allow session cookies". I no case does it prompt me when the FormsAuthentication.SetAuthCookie() is called. I also deleted everything from "Temporary Internet Files" and watched as I logged in, then refreshed that dir and no cookies show up there.

    I also did this:
    ---------------------------------
    private void Page_Load(object sender, System.EventArgs e)
    {
    testLabel.Text = FormsAuthentication.FormsCookiePath + FormsAuthentication.FormsCookieName;
    }
    ---------------------------------
    ... and here is what it output:

    /.ASPXAUTH

    I searched for .ASPXAUTH and it is nowhere on my C drive.
    ---------------------------------
    I set my web.config:
    <authentication mode="Forms">
    <forms loginUrl="Includes/Login.aspx" protection="All" timeout="10000" />
    </authentication>

    .. to 10000 which should translate to 166+ hours if it is doing what it is supposed to, and if it is reading seconds, then it would be 166+ minutes.
    ---------------------------------

    Does anyone have any thoughts on why this might happen and how I might be able to fix it?

    Also, does anyone you know how can I see what the SetAuthCookie() cookie is being set to for time?

    tx,
    k

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Try adding a path="/" attribute to your <forms /> tag: http://samples.gotdotnet.com/quickst...formsauth.aspx . Also, if you want to be able to read the cookie, set protection="None"; otherwise, the cookie will be encrypted.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center