Answers.Body: <p>Create a <code>commerce.php</code> config file in your <code>config</code> folder and set the <code>cartCookieDuration</code> to a time interval. The default is 3 months.</p>
  
  <pre><code>&lt;?php
  return [
      'cartCookieDuration' =&gt; 'P3M',
      'purgeInactiveCarts' =&gt; true,
      'purgeInactiveCartsDuration' =&gt; 'P3M',
  ];
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-25T23:16:19.747Z
Answers.Text: Oh that's very helpful!  Thank you!
Answers.UserDisplayName: biko
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-25T03:48:35.933Z
Answers.LastActivityDate: 2019-07-25T03:48:35.933Z
Answers.UserDisplayName: Luke Holder
Body: <p>Is it possible to change the cookie timeout just for the cart?  E.g. I'd like to clear abandoned carts after X hours and keep all the other sessions untouched (e.g. user sessions etc).</p>
  
  <p>Please advise anyone!</p>
  
Tags: <plugin-craftcommerce><craft2><session><cookies><timeout>
Title: Craft 2 Commerce 1 cart session expiry
ThreadText: # Craft 2 Commerce 1 cart session expiry
  
  (Asked by: username_0 on 2019-07-25)
  
  Is it possible to change the cookie timeout just for the cart? E.g. I'd like to clear abandoned carts after X hours and keep all the other sessions untouched (e.g. user sessions etc).
  
  Please advise anyone!
  
  **Tags:** plugin-craftcommerce, craft2, session, cookies, timeout
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-07-25. Score: 2 | Accepted answer
  
  Create a `commerce.php` config file in your `config` folder and set the `cartCookieDuration` to a time interval. The default is 3 months.
  
  ```
  <?php
  return [
      'cartCookieDuration' => 'P3M',
      'purgeInactiveCarts' => true,
      'purgeInactiveCartsDuration' => 'P3M',
  ];
  
  ```
  
  > **Comments:**
  > **username_0**: Oh that's very helpful!  Thank you!  
  
  ---
  
  