Session Id's

Discussion in 'Search Engine Optimization' started by TheWebJunkie, Mar 23, 2005.

  1. #1
    Hey all another problem with my site, someone told me this

    my site is sigtraders.com

    "but session ID's in your URL's is going to kill your SERPS!"

    Could someone explain what they are talking about, and could anyone help me fix it

    heres what a few ppl suggested.

    "Also you can get rid of the SESSIONID with the following code snippets"

    
     set_magic_quotes_runtime(0);
    
    ini_set('session.use_only_cookies', true);
    ini_set ('url_rewriter.tags', '');
    
    /*
    session.use_trans_sid cannot be changed via ini_set as it
    The decision to enable the rewriter is made before your
    script starts running.
    */ 
    
    PHP:
    Reply 2

    "You could try adding these two lines before you start your session."

    
    ini_set('session.use_trans_sid', false);
    ini_set("url_rewriter.tags","");
    session_start();
    
    PHP:
    Reply 3

    "It's even easier than that, there is a line you can put in the .htaccess file that will disable session ids."

    php_flag session.use_trans_sid off

    put that in your .htaccess file in the root directory, should disable the php session ids in the url


    What do you guys think is the best option ?
     
    TheWebJunkie, Mar 23, 2005 IP
  2. WhatiFind

    WhatiFind offline

    Messages:
    1,789
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    180
    #2
    Google doens't index pages with phpsessions, use the php code to disable sessions
    ini_set('session.use_trans_sid', false);
    Code (markup):
    I haven't got experience by doing it in .htaccess
     
    WhatiFind, Mar 23, 2005 IP
  3. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #3
    crazyhorse, Mar 23, 2005 IP
  4. TheWebJunkie

    TheWebJunkie Banned

    Messages:
    630
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #4
    TheWebJunkie, Mar 23, 2005 IP
  5. GTech

    GTech Rob Jones for President!

    Messages:
    15,836
    Likes Received:
    571
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I create a php.ini file and put it in the root of my sites where sessions are possible.

    Just that one file, with the following:

    
    url_rewriter.tags = ""
    session.use_trans_sid = 0
    session.use_cookies = 1
    session.use_only_cookies = 1
    
    Code (markup):
     
    GTech, Mar 23, 2005 IP
  6. TheWebJunkie

    TheWebJunkie Banned

    Messages:
    630
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hey Gtech thanks for the tip, can anyone confirm i can use this method and it wont damage my site in any way ?
     
    TheWebJunkie, Mar 23, 2005 IP
  7. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It will damage your site. People with cookies disabled will not be able to maintain a session (i.e. login, access member areas, etc). If that's not a problem, then go with it.
     
    nullbit, Mar 23, 2005 IP
  8. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #8
    Agreed, after reading the php manual, that's about the jest of it.

    vBulletin has some stuff in it to let google and a few others spider without sessions. If you have access to that code, I would suggest using it for an example. Of course the code is copyrighted, but the idea aint.
     
    noppid, Mar 23, 2005 IP
  9. GTech

    GTech Rob Jones for President!

    Messages:
    15,836
    Likes Received:
    571
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Incorrect, it will not damage your site. These are the same commands as noted in the first post (combined), but in a .ini file as opposed to having to enter them in multiple .php files as code. You could build a function in PHP that enables these via PHP, if you determine a search engine bot is active.

    
    <?
      $browser = array ("Gigabot","msnbot", "Googlebot", "Slurp","AltaVista","Scooter","appie","ArchitextSpider","BSDSeek","crawler@alexa.com","BSDSeek","AOL","Jeeves","T-H-U-N-D-E-R-S-T-O-N-E");
      $isBot = 0;
      while (list ($key, $val) = each ($browser)) {
        if (strstr (strtolower($_SERVER['HTTP_USER_AGENT']), strtolower($val))) {
          $isBot = 1;
        }
      }
    
      if ($isBot) {
        ini_set('session.use_only_cookies', true);
        ini_set('session.use_cookies', true);
        ini_set ('url_rewriter.tags', '');
        ini_set('session.use_trans_sid', false);
      }
    ?>
    
    Code (markup):

    Second part is an accurate assessment. If someone has cookies disabled, it would prevent session logins, if you have a login method on your site, or sessions are used to store important data (such as cart checkout information). It is a trade-off. The same assessment applies to the PHP scripted methods in post one, as does using the php.in I posted though.
     
    GTech, Mar 23, 2005 IP
  10. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Sorry to be pedantic, but that's what I meant, it will 'damage' his site in the context of handling sessions without cookies.
     
    nullbit, Mar 23, 2005 IP
  11. saltlakejohn

    saltlakejohn Guest

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    did i read wrong, or did gttech intend to create php.ini in his root directory? please don't do that. the php.ini already exists at the server level and is more or less a 'config' file for the php interpreter. you may or may not have permission to edit it, depending on who the server gods are where you worship.

    the alternative to changing the the scripture is to ammend it in your .htaccess file.
     
    saltlakejohn, Oct 3, 2005 IP