From 656c8fb3f2b288d406251fc93d9eb0ca774a3141 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sun, 2 Aug 2009 00:21:59 +0200
Subject: [PATCH] Use the server port in DOKU_COOKIE when securecookie is
 defined FS#1664

Ignore-this: de9ef30fc53fbfc1caa74b55f97290a5

This should avoid problems on portbased virtual hosts.
This patch might log you out ;-)

darcs-hash:20090801222159-7ad00-808a91dd29af758ef10d7942888c2c22d8b8b888.gz
---
 inc/init.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/inc/init.php b/inc/init.php
index f642c8dcf..d84c5a232 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -144,8 +144,8 @@
   if(!defined('DOKU_LF')) define ('DOKU_LF',"\n");
   if(!defined('DOKU_TAB')) define ('DOKU_TAB',"\t");
 
-  // define cookie and session id
-  if (!defined('DOKU_COOKIE')) define('DOKU_COOKIE', 'DW'.md5(DOKU_REL));
+  // define cookie and session id, append server port when securecookie is configured FS#1664
+  if (!defined('DOKU_COOKIE')) define('DOKU_COOKIE', 'DW'.md5(DOKU_REL.(($conf['securecookie'])?$_SERVER['SERVER_PORT']:'')));
 
   // define Plugin dir
   if(!defined('DOKU_PLUGIN'))  define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
-- 
GitLab