# Cookies after login are not received by my web

**URL:** <https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520>\
**Category:** Get Help\
**Tags:** authentication-sessions, sessions\
**Created:** [September 6, 2023, 9:35am UTC](https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520 "2023-09-06T09:35:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pb2023](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pb2023/32/50070_2.png) [@pb2023](https://community.auth0.com/u/pb2023)\
**Post date:** [September 6, 2023, 9:35am UTC](https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520/1 "2023-09-06T09:35:34Z")

</div>

Hello, can you advice me why cookies are not sent to my web page after login. I can see some cookies like auth0\_compt and auth0 during autentification via auth0 login form but it is just on auth0 pages like /authorize and /resume.

Thank you

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [September 6, 2023, 1:32pm UTC](https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520/2 "2023-09-06T13:32:38Z")

</div>

Hey there @pb2023 !

As a first step of the investigation I think you may want to learn about the cross-domians cookies storage restrictions in your browser policy. Thanks!

---

<div class="post-metadata">

**Author:** ![pb2023](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pb2023/32/50070_2.png) [@pb2023](https://community.auth0.com/u/pb2023)\
**Post date:** [September 7, 2023, 4:19am UTC](https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520/3 "2023-09-07T04:19:59Z")

</div>

Thank you, I have allowed all cookies now, but I have still the same problem. I will be very helpful for any other suggestions.

And how can user uses auth0 login if has blocked 3rd party cookies?

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [September 7, 2023, 10:04am UTC](https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520/4 "2023-09-07T10:04:17Z")

</div>

Thanks for following up!

Can you maybe share some context in which you use Auth0?

In general, Auth0 SDKs that support recommended for the specific app types login flows are here to do it for you.  
If you would like to see the solutions provided by Auth0 in action, you can set up a sample app, for example - [GitHub - auth0-samples/auth0-javascript-samples: Auth0 Integration Samples for Vanilla JavaScript Applications](https://github.com/auth0-samples/auth0-javascript-samples/tree/master) to see the authentication process in your browser.

There is also a cookies section in our docs that you may find helpful - [Cookies](https://auth0.com/docs/manage-users/cookies)

* * *

[📹 _Prefer how-to videos instead of written docs? We’ve got you covered! Check out our OktaDev YouTube channel for those helpful resources!_](https://www.youtube.com/@OktaDev/videos)  
—----------------------------------------------------------------------------------------------------------------------------

---

<div class="post-metadata">

**Author:** ![pb2023](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pb2023/32/50070_2.png) [@pb2023](https://community.auth0.com/u/pb2023)\
**Post date:** [September 8, 2023, 4:18am UTC](https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520/5 "2023-09-08T04:18:43Z")

</div>

I set up auth0 according to steps from this quickstart [Auth0 PHP SDK Quickstarts: Add Login to your PHP application](https://auth0.com/docs/quickstart/webapp/php/interactive)

And now I am using this code to check if user is authenticated, but it is still false.

```auto
	// Check if user is not authenticated
	if (!$sdk->isAuthenticated()) {

	    // Redirect user to Auth0 login page
		$loginUrl = $sdk->login();
		header("Location: $loginUrl");
		exit;
	}

```

And it is not bad idea, I will download sample and try to check the flow. Thanks

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [September 8, 2023, 12:28pm UTC](https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520/6 "2023-09-08T12:28:21Z")

</div>

Sure thing!

Very often issues encountered with our quickstarts can be narrowed down to a wrong configuration between the client app and Auth0.

In terms of your code snippet:  
`If the condition to send the user to the login page amounts to false, it can be that there is already a [valid session] for a user (https://auth0.com/docs/authenticate/login/logout)` →

> **[Log Users Out of Identity Providers](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-idps)**
>
> Describes how to force a user to log out of their identity provider.

> **[Log Users Out of Applications](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-applications)**
>
> Describes how to force a user to log out of applications using the Auth0 logout endpoint.

> **[Use the OIDC Endpoint to Log Users Out of Auth0](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0)**
>
> Describes how to force a user to log out of Auth0 using the Auth0 Logout endpoint.

Hope this helped! Please let me know in case you have questions at some point!

* * *

[📹 _Want to join our next Community Interactive Q&A with our experts? This time we’re gonna talk about Auth0 Terraform Provider_](https://community.auth0.com/t/ask-me-anything-with-auth0-terraform-provider/115670)

---

<div class="post-metadata">

**Author:** ![pb2023](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pb2023/32/50070_2.png) [@pb2023](https://community.auth0.com/u/pb2023)\
**Post date:** [September 10, 2023, 7:32pm UTC](https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520/7 "2023-09-10T19:32:43Z")

</div>

Thanks, but I think logout is not problem bcz when I use logout.php page and then login.php then I am redirected to auth0 login page. If I am not logged out then it will not show auth0 login web page and it will redirect me to page which I have set up and should be showed after successfull login…

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [September 12, 2023, 8:04am UTC](https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520/8 "2023-09-12T08:04:48Z")

</div>

Hi and thanks for following up!  
Did you manage to set up your php sample?

> And now I am using this code to check if user is authenticated, but it is still false.

Do you mean that after a user successfully authenticate against Auth0, the condition resolve to false?  
Taking into account the _exclamation sign_ before the “$sdk” variable: (if ( **!** $sdk-\>isAuthenticated()) {…}; , it would be an expected behaviour (the negation of true resolving to false).

* * *

[📹 _Want to join our next Community Interactive Q&A with our experts? This time we’re gonna talk about Auth0 Terraform Provider_](https://community.auth0.com/t/ask-me-anything-with-auth0-terraform-provider/115670)

---

<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:** [September 26, 2023, 8:04am UTC](https://community.auth0.com/t/cookies-after-login-are-not-received-by-my-web/115520/9 "2023-09-26T08:04:57Z")

</div>

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