# PHP SDK 8 - Invalid State After SignUp Redirect

**URL:** <https://community.auth0.com/t/php-sdk-8-invalid-state-after-signup-redirect/80550>\
**Category:** Get Help\
**Tags:** auth0-php\
**Created:** [March 25, 2022, 3:12pm UTC](https://community.auth0.com/t/php-sdk-8-invalid-state-after-signup-redirect/80550 "2022-03-25T15:12:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![evansims](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evansims/32/27011_2.png) [@evansims](https://community.auth0.com/u/evansims)\
**Post date:** [March 25, 2022, 5:09pm UTC](https://community.auth0.com/t/php-sdk-8-invalid-state-after-signup-redirect/80550/2 "2022-03-25T17:09:38Z")

</div>

Hi @paulrileydnrg 👋

An InvalidState exception is [thrown from the PHP SDK](https://github.com/auth0/auth0-PHP/blob/main/src/Auth0.php#L322) during `exchange()` when the `state` parameter returned by Auth0 doesn’t match the temporary cookie stored on the client when `login()` is fired before the redirect. This means there is either an issue with the cookie getting stored properly on the client before getting redirected, being retrieved from the client during callback, or an issue with pulling the state response from the callback request.

- Check your Auth0 logs for anything out of the ordinary with the request
- Ensure you have both `code` and `state` parameters the URI of your application’s callback; if there is an error parameter something is going wrong with the request, and should be in your Auth0 logs
- Use your browser dev tools to ensure the transient cookie is being set properly before the redirect
- Unrelated, but we have an `Auth0::signup()` helper method for issuing the ?screen\_hint requests, so you don’t have to craft it yourself 🙂

---

_[View the full topic](https://community.auth0.com/t/php-sdk-8-invalid-state-after-signup-redirect/80550)._
