-1

I have installed cPanel (EasyApache) for a domain (Domain1.com) Later i have added a new add on domain (Domain2.com), but when i am starting php session for domain2.com it is setting domain1.con cookie in chrome network response.

set-cookie: PHPSESSID=51gjk7jr3qnscrb250j97mibh6; expires=Sat, 09-Oct-2021 15:00:35 GMT; Max-Age=31536000; path=/; domain=.domain1.com

Also chrome is giving warning for this "This Set-Cookie was blocked because its Domain attribute was invalid with regard to the current host url".

Directory structure

public_html/ (for domain1.com)
public_html/mysubdomain/domain2/ (for domain2.com)

PHP Version used

php5.6 for domain1.com
php7.1 for domain2.com

Is their any setting in php.ini or any other for fix this ?

Shubham Panchal
  • 51
  • 1
  • 2
  • 7
  • cPanel and other hosting panels are off-topic for ServerFault, please see https://serverfault.com/help/on-topic. – tater Oct 09 '20 at 15:17
  • Yes that is off-topic, i don't know but this problem can be due to php.ini settings. which is on-topic cPanel – Shubham Panchal Oct 09 '20 at 15:20
  • Questions involving cPanel, even of this nature, remain off-topic because cPanel affects everything on the server, including how things like `php.ini` are configured. (I also don't think this has anything to do with php.ini; and it's *additionally* off-topic for dealing with an unsupported version of PHP.) – ceejayoz Oct 09 '20 at 15:22

1 Answers1

0

Got that solution, edited php.ini for domain2.com

by setting this everything is working as expected

session.cookie_domain=".domain2.com"
Shubham Panchal
  • 51
  • 1
  • 2
  • 7