0

I've a problem that is can we check in php that whether or not a specific web site has set session in the browser to be more specific suppose I visit a site let say "https://example.com" and this site set session on my browser, How can i check an another my Own
php file that this site has set session on my browser? If this is not possible then my specific problem is that I'm working in a client project which is deployed on cpanel and I've created subdomain of it's site now i want that when the main site(domain) set session for a user how can i check it in the subdomain. say main domain is "https://example.com" and subdomain is "https://ar.example.com" both site is in php.

  • https://stackoverflow.com/questions/18492576/share-cookie-between-subdomain-and-domain – cske Nov 09 '18 at 19:28

1 Answers1

0

Setting the cookie domain variable to set the scope of session at the website level, will ensure the session set in one sub-domain can be accessed by multiple sub-domains including www.

<?php
ini_set('session.cookie_domain', '.website.domain');
?>