Forum Moderators: coopster

Message Too Old, No Replies

php session codes bad for search engines

         

esllou

11:18 am on Jan 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am using session codes in php to dynamically load content onto my web pages...would this affect my search engine positions.

the session id gets attached to every internal link url only for the first web page of a session, then disappears.

is this likely to cause problems for me or not?

esllou

11:44 am on Jan 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ok, here is my code which says to set a session id and if the person has arrived from overture, to load a different "affiliate-id".

what I would prefer is for a session id ONLY to be set if the referrer is "overture" and, otherwise, for there to be NO session id at all:


<?
session_start();
if(!$_SESSION['overture']){
$_SESSION['overture'] = $HTTP_GET_VARS['referrer'];
}
function showlink($url)
{
global $_SESSION;
if ($_SESSION['overture'] =="overture")
{
$url = str_replace("affiliate-id-1","affiliate-id-2",$url);
}
echo $url;
}
?>

ergophobe

5:32 pm on Jan 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The problem is that every time Google crawls that first page, it will have a different session ID on all of your links. I believe that as far as Google is concerned, that would mean that all of your old pages have dissappeared and have been replaced by new pages.

If you simply restrict sessions to users with cookies enabled, or you don't start a session if the user agent is the googlebot, you would be okay.

This thread might help you some

[webmasterworld.com...]

esllou

10:06 pm on Jan 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



but if I use something like:


if ($HTTP_GET_VARS['referrer'] == 'overture') {
// add on your session id
}

then a session id won't be set if any search engine spider comes along...so there won't be any problems? If I use that above code, only "overture" referrals will get tagged with session ID's, no?

or is there something I am missing?

ergophobe

12:57 am on Jan 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sure, if you only start sessions for overture referrals, then it should be fine with Google.