Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ICW+Dreamscapes's GOOGLE Sid-Killer code in one place!


Guest

Recommended Posts

(following is a duplicated post from another thread ... hoping to offer convenience to others)

 

Let me say this is not *my* mod .. I am just putting in place a way of killing Google Sid as crafted by :

 

1. Ian C Wilson; and

2. dreamscape

 

Full credits to both the creators only!

 

 

Why? ... well, the discussion on ICW's mod is so very well rich and evolving that one needs to scan 10 pages of posts on this forum to finally arrive at the correct code to put in place. After having spent 3 hours only to read (and wondering to know that I am pretty dumb even now :o ) I think all the correct and tested code in one place will help everyone. Here it goes:

 

Step 1:

 

Add the following code just before the ?> tag at the end of /catalog/includes/application_top.php file:

 

//================================================================ 

if ( ($HTTP_GET_VARS['currency']) ) { 

  tep_session_register('kill_sid'); 

  $kill_sid=false; 

 } 

if ( ($HTTP_GET_VARS['language']) ) { 

 tep_session_register('kill_sid'); 

 $kill_sid = false; 

 } 

if (basename($_SERVER['HTTP_REFERER']) == 'allprods.php' ) $kill_sid = true; 

if ( ( !tep_session_is_registered('customer_id') ) && ( $cart->count_contents()==0 ) && (!tep_session_is_registered('kill_sid') ) ) $kill_sid = true; 

if (basename($PHP_SELF) == FILENAME_LOGIN ) $kill_sid = false; 

//================================================================

Step 2:

 

Find

 

$breadcrumb = new breadcrumb;

 

Add after the above:

 

  $kill_sid=true;

 

Step 3:

 

Now find the function tep_href_link (should be the first one) in /catalog/includes/functions/html_output.php

 

After the first line

  function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {

 

add the line

 

    global $kill_sid;

 

Step 4:

 

Within this html_output.php file only:

 

find the lines

 

if ( (isset($sid) ) { 

     $link .= $separator . $sid; 

   }

 

change to:

 

if ( (isset($sid) ) && ( !$kill_sid ) ) { 

$link .= $separator . $sid; 

}

 

Warnings. The code above has been tested on a clean oscommerce installation. The only problem reported has been with 'USE_DEFAULT_LANGUAGE_CURRENCY' set in admin.

 

You may also want to include another mod (download here: http://www.oscommerce.com/contributions/bu...tton_v1.01.zip) that changes buy-now buttons to initiation form actions with *post* action as against the default *get* action to *not generate* session id's.

 

Well, the story ends here, and the Kings and Queens of osC world may now rest in peace for ever, despite a monthly visit from the dreaded Google Robot!

 

 

Sunny

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

i have carried out the changes as mentioned above, and when i log in and browse my site as hoped i dont get any session id.

 

But today wathcing the googlebots crawling my site, i notice about 70% of them have a sID, this is in the 'who's online' view in admin.

 

I am using search engine safe URL's (i have had no problem with these . .. yet)

i am also using a different sID (cplusid) which i changed in application_top.

 

Any ideas greatly appreciated :)

 

Regards

 

Matt

www.consoleplus.co.uk

Link to comment
Share on other sites

Off topic,

 

Matt, when I checked you page (very nice!) I got this at top:

 

Warning: Installation directory exists at: /home/consoleplus/public_html/catalog/install. Please remove this directory for security reasons.

 

John

Link to comment
Share on other sites

Hi,

 

i have carried out the changes as mentioned above, and when i log in and browse my site as hoped i dont get any session id.

 

But today wathcing the googlebots crawling my site, i notice about 70% of them have a sID, this is in the 'who's online' view in admin.

 

I am using search engine safe URL's (i have had no problem with these . .. yet)

i am also using a different sID (cplusid) which i changed in application_top.

 

Any ideas greatly appreciated :)

 

Regards

 

Matt

www.consoleplus.co.uk

 

Hi matt,

 

I went to your site and noticed that you did not change the "buy now" buttons to forms. they are still links and thus google can follow them and fill your cart up and create session IDs in the links then.

 

you have them on "reviews":

http://www.consoleplus.co.uk/catalog/produ...21/reviews_id/1

 

and whats new:

http://www.consoleplus.co.uk/catalog/products_new.php

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

Matt your SID killer is not functioning correctly.

 

When I disable cookies I cant add to the cart at all.

It doesnt even add to the cart, whereas normally it would add to the cart, but would not let you checkout as it normally loses the items when you do.

 

Your SID killer seems to kill it no matter whether it is google or a normal user.

 

I would check your code again mate.

 

CC.

Link to comment
Share on other sites

Cheers chris, yea does seem that way :/

 

are you using a sID killer at all m8, if so, which one?

 

I have just used the above changes.

 

dang thought i had it sussed :)

 

Cheers

 

Matt

Link to comment
Share on other sites

for step 2 is have used:

 

if ( ( !tep_session_is_registered('customer_id') ) && ( $cart->count_contents()==0 ) && (!tep_session_is_registered('kill_sid') ) ) {$kill_sid = true;}

 

i have fixed the problem of cookies disabled = nothing adds to cart, that was because I was using search engine safe URL's (i didn't realise that they were dependant on cookies, pity:/)

 

now all seems to be working fine, fingers crossed - if anyone knows different your feedback is much much appreciated.

 

On a total side note, can anyone please point me to the meta tag creator / controller contribution, i have spent the last 20 mins looking through the contributions but i cannot find it (wish there was a search option:))

 

Cheers

 

Matt

www.consoleplus.co.uk

Link to comment
Share on other sites

step 2 is an old version of step 1 I think...

 

doing step 1 and skipping step 2 is what you should do... if you notice what you did for step 2 is part of step 1...

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...