PHP Session IDs are killing me, Please help.

Discussion in 'PHP' started by Seobiznezzy, Sep 14, 2005.

  1. #1
    Boy, I hope someone can help me with this.

    When google goes through my site, it sees two things, it can go through the site and see

    www.mysite.com/widgets.php

    and it also goes through the site and sees

    www.mysite.com/widgets.php?PHPSESSID=fsd9876ewhwf7

    From what people are telling me this is a big mistake because it is seeing 2 pages with identical content and is punishing me, where as it is actually just one page.

    Obviously, I would like to have the one without the Session Id as that is better for the search engines.

    What should I do????
     
    Seobiznezzy, Sep 14, 2005 IP
  2. subseo

    subseo Guest

    Messages:
    652
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It is often a problem with webhost. For my CMS, it was solved by adding the following to the .htaccess:
    
    <IfModule mod_php4.c>
      php_value session.use_only_cookies        1
      php_value session.use_trans_sid           0
    </IfModule> 
    
    Code (markup):
    Not sure if that's completely cms independant and will work with your cms.
     
    subseo, Sep 15, 2005 IP
  3. michele

    michele Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I've seen quite a few posts like this lately, some suggesting that it could be something Google has done.

    Anyway, another solution I've seen proposed involves something a little like cloaking but which IS NOT cloaking:

    In your code, you need to check who is coming to your page (ie an SE bot or a real user), and either set a session ID or not depending on that.

    This is a non-trivial intervention into the code, but may be worth it if the problem persists and is causing enough grief.
     
    michele, Sep 20, 2005 IP
  4. Connect

    Connect Guest

    Messages:
    191
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This problem happens to me too. Maybe I should try the code by subseo...
     
    Connect, Sep 21, 2005 IP