# context.stats.loginsCount undefined

**URL:** <https://community.auth0.com/t/context-stats-loginscount-undefined/7344>\
**Category:** Get Help\
**Tags:** rules, loginscount, hooks\
**Created:** [June 30, 2017, 9:51pm UTC](https://community.auth0.com/t/context-stats-loginscount-undefined/7344 "2017-06-30T21:51:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![acabler](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/acabler/32/7768_2.png) [@acabler](https://community.auth0.com/u/acabler)\
**Post date:** [June 30, 2017, 9:51pm UTC](https://community.auth0.com/t/context-stats-loginscount-undefined/7344/1 "2017-06-30T21:51:06Z")

</div>

In my rules, I am often getting context.stats.loginsCount undefined. Also, user.logins\_count is undefined but this seems to be expected. Viewing these users in the dashboard shows that loginsCount is valid and \> 0. I also have a post-registration hook that sometimes fails to fire at all and I believe it might be related if it is using loginsCount as well.

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [July 5, 2017, 9:38am UTC](https://community.auth0.com/t/context-stats-loginscount-undefined/7344/2 "2017-07-05T09:38:45Z")

</div>

Can you describe what authentication flow the Rule is running for, e.g. what endpoints you called, where you saw the error etc.

---

<div class="post-metadata">

**Author:** ![wisam.hassoun](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@wisam.hassoun](https://community.auth0.com/u/wisam.hassoun)\
**Post date:** [December 14, 2017, 10:22pm UTC](https://community.auth0.com/t/context-stats-loginscount-undefined/7344/3 "2017-12-14T22:22:52Z")

</div>

+1 This happens to me aswell…

---

<div class="post-metadata">

**Author:** ![wisam.hassoun](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@wisam.hassoun](https://community.auth0.com/u/wisam.hassoun)\
**Post date:** [December 14, 2017, 10:22pm UTC](https://community.auth0.com/t/context-stats-loginscount-undefined/7344/4 "2017-12-14T22:22:52Z")

</div>

+1 This happens to me aswell…

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [December 15, 2017, 5:09pm UTC](https://community.auth0.com/t/context-stats-loginscount-undefined/7344/5 "2017-12-15T17:09:59Z")

</div>

Depending on how you’re performing the authentication request the unavailability of the logins count may be a bug; check this [answer](http://community.auth0.com/answers/12876/view) to a similar question for two situations that exhibit that behavior. In my opinion it’s really a bug so I raised an issue internally, however, I’ll update that answer when I have more definitive information.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/context-stats-loginscount-undefined/7344/6 "2018-03-02T05:55:06Z")

</div>


