Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Thee directions say After the follwing line:

 

else {

die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br>

<b>Unable to determine connection method on a link!<br><br>Known methods:

NONSSL SSL</b><br><br>');

}

 

add:

 

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

$l = ereg('[&\?/]?language[=/][a-z][a-z]', $parameters, $m);

if ($l) {

$parameters = ereg_replace("[&\?/]?language[=/][a-z][a-z]", "", $parameters);

$HTTP_GET_VARS['language'] = substr($m[0],-2);

}

if (tep_not_null($parameters)) {

$parameters .= "&language=" . $HTTP_GET_VARS['language'];

} else {

$parameters = "language=" . $HTTP_GET_VARS['language'];

}

}

 

 

and finally

 

find the lines

 

if (isset($sid)) {

$link .= $separator . $sid;

}

and change to

 

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

$link .= $separator . $sid;

}

 

 

I can't find the bolded code. I don't have it in my html_output.php. Any suggestions?

Posted
Thee directions say After the follwing line:

 

else {

die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br>

<b>Unable to determine connection method on a link!<br><br>Known methods:

NONSSL SSL</b><br><br>');

}

 

add:

 

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

$l = ereg('[&\?/]?language[=/][a-z][a-z]', $parameters, $m);

if ($l) {

$parameters = ereg_replace("[&\?/]?language[=/][a-z][a-z]", "", $parameters);

$HTTP_GET_VARS['language'] = substr($m[0],-2);

}

if (tep_not_null($parameters)) {

$parameters .= "&language=" . $HTTP_GET_VARS['language'];

} else {

$parameters = "language=" . $HTTP_GET_VARS['language'];

}

}

and finally

 

find the lines

 

if (isset($sid)) {

$link .= $separator . $sid;

}

and change to

 

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

$link .= $separator . $sid;

}

I can't find the bolded code. I don't have it in my html_output.php. Any suggestions?

 

 

I did somee searching aand since I added the Ultimate SEO Contribution some of the code I need to change is gone. So who has installed both the Ultimate SEO Contribution and the Sid killer contribution?

Posted
I did somee searching aand since I added the Ultimate SEO Contribution some of the code I need to change is gone. So who has installed both the Ultimate SEO Contribution and the Sid killer contribution?

 

with regard to your PM, I put it here as PM's with code are very difficult to read.

 

 

 

first read this:

 

http://www.oscommerce.com/forums/index.php?showtopic=182189

 

 

Then realize that there will always remain situations where the sid needs to be added to the url.

That is: When cookies are not being set and it is not required or when you do not know that yet.

 

Then forget that sid killing stuff, that is a patch strategy.

 

The key is the cookie acceptance, not language changes or particular pages.

 

Normally OSC only sets a test cookie when cookies are forced, bull ofcourse.

 

Always try to set a test cookie because by reading that cookie we can determine whether to attach the sid to the url

AND whether we can eliminate the client from being a spider (the topic of that tip).

 

So if we can read the test cookie, even on the first page load, we need not attach the sid to the url, not even then.

 

in application top ofcourse as per the above tip :

 

$session_started = false;

$spider_flag = false;

 

if (isset($_COOKIE['cookie_test'])) {

$cookies_exist = true;

tep_session_start();

$session_started = true;

} else {

$cookies_exist = false;

tep_setcookie('cookie_test', 'ThankYou', time()+60*60*24*30, $cookie_path, $cookie_domain);

if (SESSION_FORCE_COOKIE_USE != 'True') {

require('z:/appl/spider_check.php');

if (!$spider_flag) {

tep_session_start();

$session_started = true;

}

}

}

 

if (!tep_session_is_registered('cookies_exist')) {

tep_session_register('cookies_exist');

}

 

 

 

Not adding session_id in tep_href_link by adding that condition to :

 

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined

if ( ($add_session_id == true) &&

($session_started == true) &&

(SESSION_FORCE_COOKIE_USE == 'False') &&

(!$cookies_exist) // ********************* this means we can read the cookie

......

 

(do not forget the register that variable as global in the function!)

 

 

 

That still leaves the situation when a client comes in for the very very first time and still has no cookies

for you to read. Well, there is no way around that. The only reason why I do not get that is because I use the

BR&R contrib that redirects the client using js to determine their screen resolution (a totally different purpose but that has this side-effect).

 

So you get something like:

 

site_address/?azx=1018

 

which is by then the second page and as such no longer with attached SID's. (if cookies accepted)

 

But, disable js and you will not be redirected and you will see the sid (on the first page only) if you accept

cookies and always if you don't.

 

So, bottom line,

 

- Always use cookies (even if you do not force them)

for this and the spiderlist circumvention

- only attach sid if cookies are not set or spiders

 

 

or simply use force cookies but then extend the cookie warning to the use of ANY session variable as they all

stop to work when cookies are refused with this setting, not just "add to cart", etc.

Treasurer MFC

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...