I want to set the cookie FormsAuthentication to timeout, but VIA CODE

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

<system.web>
        <authentication mode="Forms">
              <forms timeout="50000000"/>
        </authentication>
    </system.web>
+3
source share
1 answer

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

+5
source

Source: https://habr.com/ru/post/1709668/


All Articles