I have tried to install this Recommended Mod by CyberAlien for Removing Guest Sessions SID's but I still keep getting the SID's when I'm logged out?
Why isn't it removing the SID like it should?
(If anyone uses any other solution that works I'll be very happy to hear)
This is very important for SEO!
This is the Mod I used:
(You only need to mess with /includes/sessions.php to check it out)
- Code: Select all
################################################################# ## MOD Title]http://www.phpbbstyles.com#[/url]# MOD Description: ## This mod removes session id for guests from url and this way## guests who don't have cookies like different robots will use## correct urls. It can be used to allow googlebot and other## search engines to spider your forum correctly.#### Installation Level: Easy## Installation Time: 1-2 Minutes## Files To Edit (1): includes/sessions.php############################################################## ## For Security Purposes, Please Check: [url=http://www.phpbb.com/mods/]http://www.phpbb.com/mods/[/url] for the ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered ## in our MOD-Database, located at: [url=http://www.phpbb.com/mods/]http://www.phpbb.com/mods/[/url] ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ OPEN ]--------------------------------------------- # includes/sessions.php ##-----[ FIND ]---------------------------------------------# around line 157 $sql = "UPDATE " . SESSIONS_TABLE . " SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_admin = $admin WHERE session_id = '" . $session_id . "' AND session_ip = '$user_ip'"; # #-----[ REPLACE WITH ]---------------------------------------# $sql_ip = $user_id == ANONYMOUS ? " AND session_ip = '$user_ip'" : ''; $sql = "UPDATE " . SESSIONS_TABLE . " SET session_ip = '$user_ip', session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_admin = $admin WHERE session_id = '" . $session_id . "' $sql_ip AND session_user_id = '$user_id'"; ##-----[ FIND ]---------------------------------------------# around line 210 $SID = 'sid=' . $session_id; # #-----[ REPLACE WITH ]---------------------------------------# $SID = $user_id > 0 ? 'sid=' . $session_id : ''; ##-----[ FIND ]---------------------------------------------# around line 288 $SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : ''; # #-----[ REPLACE WITH ]---------------------------------------# $SID = $userdata['user_id'] > 0 ? (($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '') : ''; ##-----[ FIND ]---------------------------------------------# around line 340 // // If we reach here then no (valid) session exists. So we'll create a new one,# #-----[ BEFORE, ADD ]---------------------------------------# elseif(empty($sessiondata)) { // try to login guest $sql = "SELECT u.*, s.* FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u WHERE s.session_ip = '$user_ip' AND s.session_user_id = " . ANONYMOUS . " AND u.user_id = s.session_user_id LIMIT 0, 1"; if ( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); if ( isset($userdata['user_id']) ) { if ( $current_time - $userdata['session_time'] > 60 ) { $sql = "UPDATE " . SESSIONS_TABLE . " SET session_time = $current_time, session_start = $current_time, session_page = 0 WHERE session_id = '" . $userdata['session_id'] . "'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql); } } return $userdata; } } # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM