From 9193878c057583fb719e1765a5445aac1acdf1bc Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 7 Aug 2006 10:42:22 +0000 Subject: Fix session id assignment for bots (previously this bug related in bots creating a new session for every view, now bots are assigned one session like normal users - still no rotation). If cookie is there but having an empty session try to get it through the url - but also resetting the user git-svn-id: file:///svn/phpbb/trunk@6248 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 12ba3dba1e..118b969659 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -157,6 +157,13 @@ class session $SID = (defined('NEED_SID')) ? '?sid=' . $this->session_id : '?sid='; $_SID = (defined('NEED_SID')) ? $this->session_id : ''; + + if (empty($this->session_id)) + { + $this->session_id = $_SID = request_var('sid', ''); + $SID = '?sid=' . $this->session_id; + $this->cookie_data = array('u' => 0, 'k' => ''); + } } else { @@ -493,8 +500,8 @@ class session $this->set_login_key(); } - $SID = '?sid='; - $_SID = ''; + $SID = '?sid=' . $this->session_id; + $_SID = $this->session_id; if (!$bot) { @@ -504,8 +511,8 @@ class session $this->set_cookie('k', $this->cookie_data['k'], $cookie_expire); $this->set_cookie('sid', $this->session_id, $cookie_expire); - $SID = '?sid=' . $this->session_id; - $_SID = $this->session_id; + $SID = '?sid='; + $_SID = ''; unset($cookie_expire); } -- cgit v1.2.1