# Log in from different subdomain and getting state error

**URL:** <https://community.auth0.com/t/log-in-from-different-subdomain-and-getting-state-error/97384>\
**Category:** Get Help\
**Tags:** authentication-sessions, sessions\
**Created:** [January 3, 2023, 10:15am UTC](https://community.auth0.com/t/log-in-from-different-subdomain-and-getting-state-error/97384 "2023-01-03T10:15:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![team4](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/team4/32/12714_2.png) [@team4](https://community.auth0.com/u/team4)\
**Post date:** [January 3, 2023, 10:15am UTC](https://community.auth0.com/t/log-in-from-different-subdomain-and-getting-state-error/97384/1 "2023-01-03T10:15:08Z")

</div>

# [Log in from different subdomain produces state error](https://community.auth0.com/t/log-in-from-different-subdomain-produces-state-error/19116)

I tried by following above step

I have two sub domain and both are auth0 lock

and I tried login and got error

and i can’t find parseHash in auth0 lock and could you provide code auth0-lock in two sub domain?

---

<div class="post-metadata">

**Author:** ![SaqibHussain](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/saqibhussain/32/42924_2.png) [@SaqibHussain](https://community.auth0.com/u/SaqibHussain)\
**Post date:** [January 26, 2023, 9:40pm UTC](https://community.auth0.com/t/log-in-from-different-subdomain-and-getting-state-error/97384/3 "2023-01-26T21:40:45Z")

</div>

Hi @team4

Welcome to the Auth0 Community.

parseHash is part of the auth0.js library [https://auth0.github.io/auth0.js/WebAuth.html#parseHash](https://auth0.github.io/auth0.js/WebAuth.html#parseHash) so it depends on whether or not you are using this library.

After referencing the post you linked, I believe essentially when you land on your second domain you need to redirect to /authorize so the application can see if there’s a session, if not it will ask for credentials.

Warm regards.

---

<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:** [February 9, 2023, 9:41pm UTC](https://community.auth0.com/t/log-in-from-different-subdomain-and-getting-state-error/97384/4 "2023-02-09T21:41:27Z")

</div>

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