Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Help w/ Spider Session Remover


Recommended Posts



I want to implement the Spider Session Remover contrib but I'm not sure if I'm doing it correctly. It says to append the contents of the included .htaccess file to my existing .htaccess file. I know that any changes I make to .htaccess have to be made from within the file manager of my cpanel.


So, I open .htaccess in the file manager and see:

# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
order deny,allow
deny from all
AuthName www.mydomainname.com
AuthUserFile /home/domain/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/domain/public_html/_vti_pvt/service.grp


This is what's in the Spider Sessions Remover .htaccess:

# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $

# Set some options
Options -Indexes
Options FollowSymLinks

RewriteEngine on
RewriteBase /
# Skip the next two rewriterules if NOT a spider
RewriteCond %{HTTP_USER_AGENT} !(msnbot|slurp|googlebot) [NC]
RewriteRule .* - [S=2]
# case: leading and trailing parameters
RewriteCond %{QUERY_STRING} ^(.+)&osCsid=[0-9a-z]+&(.+)$ [NC]
RewriteRule (.*) $1?%1&%2 [R=301,L]
# case: leading-only, trailing-only or no additional parameters
RewriteCond %{QUERY_STRING} ^(.+)&osCsid=[0-9a-z]+$|^osCsid=[0-9a-z]+&?(.*)$ [NC]
RewriteRule (.*) $1?%1 [R=301,L]

# This is used with Apache WebServers
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
# Example:
# <Directory "/usr/local/apache/htdocs">
#   AllowOverride Options
# </Directory>
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers

<IfModule mod_setenvif.c>
 <IfDefine SSL>
SetEnvIf User-Agent ".*MSIE.*" \
		 nokeepalive ssl-unclean-shutdown \
		 downgrade-1.0 force-response-1.0

# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)

#<IfModule mod_php4.c>
#  php_value session.use_trans_sid 0
#  php_value register_globals 1


I originally just copied and pasted this code below the existing code in the .htaccess file. However, when I tried to access my site, I just got an error page, so I reverted .htaccess to its original state.


What should I do to implement Spider Session Remover? What am I doing wrong? Thanks!

Link to comment
Share on other sites

In oscommerce if you set kill spider sessin id to true that will do.


In application_top code checks by comparing the browsing agent with a list in spiders.txt and if found true considers it as a spider and so this results in spider flag set to true.


In href function if spider flag is true oscid is not concatenated.



Upsated spiders.txt and kill session id for spider as true.



Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.


Check My About US For who am I and what My company does.

Link to comment
Share on other sites



Here's what I found in my application_top.php file. Is this what you're referring to?

 } elseif (SESSION_BLOCK_SPIDERS == 'True') {
$user_agent = strtolower(getenv('HTTP_USER_AGENT'));
$spider_flag = false;

if (tep_not_null($user_agent)) {
  $spiders = file(DIR_WS_INCLUDES . 'spiders.txt');

  for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {
	if (tep_not_null($spiders[$i])) {
	  if (is_integer(strpos($user_agent, trim($spiders[$i])))) {
		$spider_flag = true;

if ($spider_flag == false) {
  $session_started = true;
 } else {
$session_started = true;


If so, have I brought all of this on myself because I don't think I have a spiders.txt file in my includes folder?


If that's the case, I've downloaded the Updated Spiders.txt contrib and will copy spiders.txt to my includes.


My question now is, will this help me immediately? I am going to have to take my client's site offline because almost everyone who goes to the shopping cart and places an order either gets someone else's order or they have extra items in their cart, etc. Will this help me right now?



Link to comment
Share on other sites

Whoops! Spoke to soon. I do have a spiders.txt file in my includes.


Still, if I replace this old one (looks like it was created in 2003) with the new one, will this help immediately?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...