# Set cookie options

**URL:** https://forum.litium.com/t/set-cookie-options/3507
**Category:** Questions
**Tags:** litium-8
**Created:** [August 7, 2025, 10:40am UTC](https://forum.litium.com/t/set-cookie-options/3507 "2025-08-07T10:40:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mattias](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mattias](https://forum.litium.com/u/mattias)
#### Post date: [August 7, 2025, 10:40am UTC](https://forum.litium.com/t/set-cookie-options/3507/1 "2025-08-07T10:40:24Z")

</div>

When a customer signs in, we would like to be able to adjust the expiration time of the authentication cookie, based on a “remember me” option. We would also like to have the ability to set sliding expiration settings. Is this somehow possible?

Litium version: 8.20.3

---

<div class="post-metadata">

### Author: ![mattias](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mattias](https://forum.litium.com/u/mattias)
#### Post date: [August 28, 2025, 8:50am UTC](https://forum.litium.com/t/set-cookie-options/3507/2 "2025-08-28T08:50:47Z")

</div>

We managed to solve this by using the HttpContext

> [@Anyone who has implemented a "keep me signed in" functionality for customer sign in?](https://forum.litium.com/t/anyone-who-has-implemented-a-keep-me-signed-in-functionality-for-customer-sign-in/3512/2):
>
> We reached out to Litium support and got some suggestions. We then managed to solve this by using the HttpContext We first use the LoginService to sign in the user. We then use the HttpContext to first sign out and then sign in the user again. When using the methods on the HttpContext it is possible to set authentication properties, for example the expiration time at which the authentication ticket should expire. await context.SignOutAsync(IdentityConstants.ApplicationScheme); await context.S…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)
#### Post date: [September 25, 2025, 8:51am UTC](https://forum.litium.com/t/set-cookie-options/3507/3 "2025-09-25T08:51:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
