Extending the timeout of users logged in via forms authentication in ASP.NET

I'm having trouble with a secure portion of my website logging users out earlier than I would like. I assume the default value is still in place, despite my attemepts to change it. I'm using a pretty basic method of forms authentication to validate users.

I have the following in my web.config:

<sessionState mode="InProc" timeout="60"/>

Open in new window


		<authentication mode="Forms">
			<forms name=".ASPXFORMSDEMO" loginUrl="http://www.mysite.com/login.aspx" protection="All" path="/secure" timeout="60" defaultUrl="~/secure/index.aspx" slidingExpiration="true"/>

Open in new window

What do I need to do to extend the session for the users once they are logged in?
Mike MillerSoftware EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Athar SyedCommented:
Try using the slidingExpiration attribute of forms authentication in web.config

<authentication mode="Forms">
  <forms loginUrl="member_login.aspx"
    slidingExpiration="true" />

Open in new window

Microsoft has the following to say about slidingExpiration (ref: MSDN Library)
Sliding expiration resets the expiration time for a valid authentication cookie if a request is made and more than half of the timeout interval has elapsed. If the cookie expires, the user must re-authenticate.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike MillerSoftware EngineerAuthor Commented:
Thanks. I had tried that without the cookieless="UseCookies"
That fixed it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.