Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98853 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50805 invoked from network); 22 Apr 2017 21:28:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Apr 2017 21:28:27 -0000 Authentication-Results: pb1.pair.com header.from=own3mall@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=own3mall@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.48 as permitted sender) X-PHP-List-Original-Sender: own3mall@gmail.com X-Host-Fingerprint: 209.85.218.48 mail-oi0-f48.google.com Received: from [209.85.218.48] ([209.85.218.48:33148] helo=mail-oi0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/17-65481-8FACBF85 for ; Sat, 22 Apr 2017 17:28:26 -0400 Received: by mail-oi0-f48.google.com with SMTP id y11so98025557oie.0 for ; Sat, 22 Apr 2017 14:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=KSBVkgohltSgDx0Xtmr+QCWUo/mlV4pNXd2wkx+3kHs=; b=Oz1wqNTukQXvxXt2p9Vp9S4mAQIBFzRniD4BrS6xcUZjeZfGe0m+Gh7qnjdrxZ1Ly5 kYp5KeIS86nNASIAH9UckZiUdDBw63yVy7BpI2N6t4dc0bpWdYCVZL0bcVvLihQGSLaW 7aT5L5MV1XKNi9XBBAC1/5L03Kh35XDlK3H6ZI+8qZn8b6Vq0M3cLUalVlb1T0wsbU8Z UN60FR0BEIdrQl7ObXKlOw4Y4Oi4L+2ptjdyEQYFy/jbZp+h8wiI15u5YHAkAisQjNuW urznhNDp0xrKT59R7en51sPwX0VK1Zuy8luxVO4l5nKYuT6FmqYzIKyu/LQzfi7ROe/h IVLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=KSBVkgohltSgDx0Xtmr+QCWUo/mlV4pNXd2wkx+3kHs=; b=cRihW/gY/JB7O37kgOtGn29aeINUHhcE5+eCUeFSo/foe8Hlx9Yvz/ykUzh2ezCPvW 0g2q0oxZK5KG0I1q7gMrjg/bNxe/Leg0CGZjMddRJuS6sP//laG3ojiRmyn9XSpY+QXi uEYyqYHBMdl4sl060ZikQnrkjpw1sP7ZdsPrHsqdkIW9f4yM5vj+v5gNKIsCUEwn056y 5rLFgBMU3Dy2s8mAjvkg8yhUUP6IdxVz0i2IoMY+McEkDsNpGaDN28PO4KNWx3jvANd6 I7U6xX9SzQ0lWVgw9+m1VXJQ/GR3AYV8ZnFu0u8tYnJHDldqfbYGZtBE2NzoozRPe6/q evBQ== X-Gm-Message-State: AN3rC/5IpikMz77KmYc1mUNJU8lyz+8sqdQlqKR89j6IE34Ur2OdCV+s 6d96tC7n7B6b5sC5qd+VCrPnU7o2Cdu5 X-Received: by 10.157.84.26 with SMTP id j26mr12841261oth.62.1492896502066; Sat, 22 Apr 2017 14:28:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.162.18 with HTTP; Sat, 22 Apr 2017 14:28:21 -0700 (PDT) Date: Sat, 22 Apr 2017 15:28:21 -0600 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: php session.cookie_domain valid across subdomains for the host name of the server which generated the cookie? From: own3mall@gmail.com (OwN-3m-All) According to the PHP docs (http://php.net/manual/en/session.configuration.php#ini.session.cookie-domain), session.cookie_domain's default value is set to the domain that generated the cookie. Default is none at all meaning the host name of the server which generated the cookie according to cookies specification Ok, so how do I set session.cookie_domain to use the cookie on subdomains and on the original domain which generated the cookie without having to specifically specify it? I'm looking for something like session.cookie_domain = .[$SERVER_NAME] Instead of having to specifically state which domain it is like countless other examples have used: session.cookie_domain = .example.com Since my server will be hosting multiple domains, is there a way to get this setting to be set dynamically based on the host that generated the cookie to use the cookie on subdomains and the domain itself in the php.ini configuration? PHP Sessions across sub domains appears to be similar to what I'm after, but I don't want to have to set it in the script. I want to set it in the php.ini configuration so that cookies issued from any of my hosted domains will also be used and valid for their corresponding subdomains.