From e06bda128a02e3552c22eed6cece40e7a6a4d150 Mon Sep 17 00:00:00 2001 From: Graham Cole <chckens@sucs.org> Date: Wed, 16 Jan 2008 21:42:13 +0000 Subject: [PATCH] work around the fact that PHP bizarrely prepends a dot to specified cookie domain names --- lib/session.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/session.php b/lib/session.php index f8bd2e9..61b92fe 100644 --- a/lib/session.php +++ b/lib/session.php @@ -34,11 +34,11 @@ private $datahash=''; // hash of data field // Create a new (insecure) session private function newsession() { - global $DB; + global $DB, $preferred_hostname; $token = $this->genSessionID(); $DB->Execute("insert into {$this->table} (hash, lastseen, ip) values (?,NOW(),?)", array($token, $_SERVER['REMOTE_ADDR'])); - setcookie("sucssite_session", $token, NULL, "/"); + setcookie("sucssite_session", $token, NULL, "/", $preferred_hostname); $this->token = $token; return; } -- GitLab