DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004

    forms authentication issue


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

    ... and even though at this help file:

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

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

    .... 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:


    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" />

    .. 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?


  2. #2
    Join Date
    Nov 2003
    Portland, OR
    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

    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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.