Question: I have a website that is using PHP sessions to enable logins etc. The site is running in an iframe on another domain (because the client need to have their owen generic frame around the site. This requires 3rd party cookies enabled for the session to work.

How can I detect in PHP if a session cookie is properly set to notify users who have 3rd party cookies disabled?

It seems that I can't use $\_SESSION or session\_id(), because they are set even without the cookie, and they're just not saved between page loads.

Answer: 
You could try `isset($_COOKIE[session_name()]);`
```
if ( isset($_COOKIE["PHPSESSID"]) && !empty($_COOKIE["PHPSESSID"]) ) {
  doStuff();
}

```