How to set asp.net Identity cookies expires time

I use Asp.Net Identity to control my app’s authorization. Now, I need to do this: if the user does not operate in 30 minutes, jump to the login page, when he login does not select “isPersistent” checkbox.
And, if he selected “isPersistent” checkbox, set the expiration date of cookie for 14 days.
I try to do this by change the Startup.Auth.cs like this: