views:

103

answers:

1

I want to set my FormsAuthentication cookie to timeout BUT VIA CODE. I know I can do this in the web.config but I want to configure at the database. Is this possible via code?

<system.web>
        <authentication mode="Forms">
              <forms timeout="50000000"/>
        </authentication>
    </system.web>
+1  A: 

To do this you'll need to create your own FormsAuthenticationTicket and cookie and add it to the response manually. See the example on the linked page.

tvanfosson