# Login's ResetPassword - how long do you have before it expires? Cache dependent?

**URL:** <https://community.modx.com/t/logins-resetpassword-how-long-do-you-have-before-it-expires-cache-dependent/4950>\
**Category:** Extras\
**Created:** [February 11, 2022, 4:42am UTC](https://community.modx.com/t/logins-resetpassword-how-long-do-you-have-before-it-expires-cache-dependent/4950 "2022-02-11T04:42:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [February 11, 2022, 9:21am UTC](https://community.modx.com/t/logins-resetpassword-how-long-do-you-have-before-it-expires-cache-dependent/4950/2 "2022-02-11T09:21:09Z")

</div>

I think you are correct.

It looks like the value gets written to the _default cache partition_ without an expiration time.

> <https://github.com/modxcms/Login/blob/04ccc73a3f93201fada4dbfbf54065ce22379038/core/components/login/controllers/web/ForgotPassword.php#L226>

* * *

Maybe it would be a better idea to use a _custom partition_ in this case:

```auto
//Writes the data to its own cache partition with an expiry time of 2 hours.
$options = array(
	xPDO::OPT_CACHE_KEY => 'resetpassword',
);
$this->modx->cacheManager->set('login/resetpassword/'.md5($fields['id'].':'.$fields['username']),$password, 7200, $options);

```

---

_[View the full topic](https://community.modx.com/t/logins-resetpassword-how-long-do-you-have-before-it-expires-cache-dependent/4950)._
