Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Spider causes cookie issues


Guest

Recommended Posts

If I switch my Prevent Spider Session to True I am directed to my Cookie Usage page after auth of a transaction. For some reason all client browsers are detected as spiders and wont allow a session to be generated. More precisely I am returned to my Cookie Usage page after the card has been authorised. This causes duplicate transactions as the order is not processed in my store and the cart has not been cleared.

 

The only way I can correctly finalize a transaction is when I turn the Prevent Spider Session to False. This is not ideal as you can imagine. I have read somewhere on the forum that I can add some code to the application_top.php that will prevent spider sessions but I am not sure if this only works in conjunction with Prevent Spider Session setting.

 

Does anybody have any good ideas on how to resolve this?

Thanks

Anton

Link to comment
Share on other sites

*bump*

anybody got any idea?

 

well, what is the url of the site?

 

and what useragent does the gateway use ?

maybe that useragent is identified as a spider.

Treasurer MFC

Link to comment
Share on other sites

well, what is the url of the site?

 

and what useragent does the gateway use ?

maybe that useragent is identified as a spider.

 

URL: www.e-tillsystems.co.uk

 

I will check into the gateway useragent issue.

 

Thanks for your help!

Link to comment
Share on other sites

well, your spider session prevention does not function.

as such all your pages will be indexed with a session id.

 

did you turn it off?

 

Yeah I know. That's just my problem. If I enable it I can not complete a transaction on my site. I am returned from my Gateway with the transaction being authorised. But from there it returns me to my Cookie Usage page. This is all due to the prevent spider session setting being on. So for the moment I have it turned off until I can figure out why all browsers are being detected as being spiders.

Link to comment
Share on other sites

Yeah I know. That's just my problem. If I enable it I can not complete a transaction on my site. I am returned from my Gateway with the transaction being authorised. But from there it returns me to my Cookie Usage page. This is all due to the prevent spider session setting being on. So for the moment I have it turned off until I can figure out why all browsers are being detected as being spiders.

 

well, backup the spiders.txt file

 

then delete all entries in the file and only add

 

bot

spider

slurp

crawler

 

turn the prevention on and test.

 

then you can add the other entries 1 by 1 and keep testing.

 

FASTER:

 

if you have access to your error log then the easier way is to add:

 

error_log('spider identified for useragent: '. $user_agent.' via: '. $spiders[$i]);

 

just after :

 

if (is_integer(strpos($user_agent, trim($spiders[$i])))) {

$spider_flag = true;

 

in application top.

 

and if a spider is identified it will put a record in the error log stating the useragent and the spiders.txt entry which matches.

Treasurer MFC

Link to comment
Share on other sites

well, backup the spiders.txt file

 

then delete all entries in the file and only add

 

bot

spider

slurp

crawler

 

turn the prevention on and test.

 

then you can add the other entries 1 by 1 and keep testing.

 

FASTER:

 

if you have access to your error log then the easier way is to add:

 

error_log('spider identified for useragent: '. $user_agent.' via: '. $spiders[$i]);

 

just after :

 

if (is_integer(strpos($user_agent, trim($spiders[$i])))) {

$spider_flag = true;

 

in application top.

 

and if a spider is identified it will put a record in the error log stating the useragent and the spiders.txt entry which matches.

 

First tried the 1st option to see if this proves the theory. That worked with the four entries. Then I implimented your last suggestion to try and capture the gateway useragent. The callback from the gateway does not create an entry in the error log. Did as you suggested:

 

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;
		error_log('spider identified for useragent: '. $user_agent.' via: '. $spiders[$i]);
		break;
	  }
	}
  }
}

 

Can you see anything wrong with the code. I havent the faintest. I am trying to get my gateway to confirm it for me otherwise I might have to go through it one by one.

 

Thanks

Link to comment
Share on other sites

First tried the 1st option to see if this proves the theory. That worked with the four entries. Then I implimented your last suggestion to try and capture the gateway useragent. The callback from the gateway does not create an entry in the error log. Did as you suggested:

 

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;
		error_log('spider identified for useragent: '. $user_agent.' via: '. $spiders[$i]);
		break;
	  }
	}
  }
}

 

Can you see anything wrong with the code. I havent the faintest. I am trying to get my gateway to confirm it for me otherwise I might have to go through it one by one.

 

Thanks

 

did you restore the original spiders.txt before you tried option 2 ?

Treasurer MFC

Link to comment
Share on other sites

did you restore the original spiders.txt before you tried option 2 ?

 

I actually tried that one first. That didnt work so I tried the 1st option to test the theory behind the spiders.

Link to comment
Share on other sites

I actually tried that one first. That didnt work so I tried the 1st option to test the theory behind the spiders.

 

did you implement SID killer or does your template implementation come with some additional stuff?

 

you have some very strange session behaviour.

Treasurer MFC

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...