0

I am using ASP.NET Forms Authentication and currently setting the timeout value in Web.config. Is there a way to set this timeout from code instead? I would like to have different timeouts for different users.

1 Answer 1

4

Check out the FormsAuthenticationTicket on MSDN

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
        "userName",
        DateTime.Now,
        your_time_out_goes_here, // value of time out property
        false, // Value of IsPersistent property
        String.Empty,
        FormsAuthentication.FormsCookiePath);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.