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.
Asked
Active
Viewed 419 times
0

Hidayat Ullah
- 147
- 9
-
https://stackoverflow.com/questions/18492576/share-cookie-between-subdomain-and-domain – cske Nov 09 '18 at 19:28
1 Answers
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');
?>

Khathiravan Raj Maadhaven
- 50
- 1
- 3
-
@Khathiraavan Raj But I'm working in the subdomain part, Is there a way to check it in the subdomain? – Hidayat Ullah Nov 09 '18 at 15:50
-
try adding the following at end of php.ini file suhosin.session.cryptdocroot=Off suhosin.cookie.cryptdocroot=Off – Khathiravan Raj Maadhaven Nov 12 '18 at 09:44
-
"The goal behind Suhosin is to be a safety net that protects servers from insecure PHP coding practices." – Khathiravan Raj Maadhaven Nov 12 '18 at 09:45