• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

PHP cookie across domain and subdomain

P

PlymWS

Guest
Hi,

I have Plesk 9.3 on a new server. I have a domian (domin.com) setup and a subdomain (sub.domain.com) setup as another domain rather than as a subdomain of the original. This allows me to specify a separate IP address for the subdomain and use 2 SSL certificates, one for the domain, one for the sub domain.

I am unable to use the sub.domain.com sookie to verify a session from domain.com Both domains are hosted on the same server and write their files to the same place.

I have tried chmod 777 the session files because the domains are controlled by a different user due to Plesk restrictions but this doesn't help.

I have also tried setting the session domain in php.ini as .domain.com but this also doesn;t help.

Anything else I can try ?
 
The issue you describe is not specific to Plesk - cookies cannot be accessed across domains.

In PHP you should be able to set the cookie with the domain in the form of ".domain.com" and this will allow the main site, and subdomains to access the cookie.

There is a section on the PHP site relating to this, specifically a section relating to setting the domain:

http://php.net/manual/en/function.setcookie.php

Paul
 
i have a similar issue and i would say it is related to plesk,
This code

<?php
ini_set('session.cookie_domain', '.domain.com' );
$some_name = session_name("domain");
session_set_cookie_params(0, '/', '.domain.com');
session_start();

makes problems go away in servers with no plesk,
but problem remains in server with plesk

surprise!

so please what is wrong in plesk configuration to interfere with session communication between subdomain and domain?

thank you
 
Back
Top