IE Page cannot be displayed error

When changing language in IE (7 and 8), I was receiving a "Page cannot be displayed". All other Browsers (FF, Opera, etc) displayed the page correct.

W3C gave me the error:

500 Too many header lines (limit is 128)

I started debugging the problem and found out, that dolphin is trying to set a HUGE amount of cookies when changing the language:

Set-Cookie: lang=deleted; expires=Mon, 16-Mar-2009 15:47:50 GMT; path=/
Set-Cookie: lang=de; expires=Wed, 16-Mar-2011 15:47:51 GMT; path=/
Set-Cookie: lang=deleted; expires=Mon, 16-Mar-2009 15:47:50 GMT; path=/
Set-Cookie: lang=de; expires=Wed, 16-Mar-2011 15:47:51 GMT; path=/
Set-Cookie: lang=deleted; expires=Mon, 16-Mar-2009 15:47:50 GMT; path=/
Set-Cookie: lang=de; expires=Wed, 16-Mar-2011 15:47:51 GMT; path=/
Set-Cookie: lang=deleted; expires=Mon, 16-Mar-2009 15:47:50 GMT; path=/
Set-Cookie: lang=de; expires=Wed, 16-Mar-2011 15:47:51 GMT; path=/
Set-Cookie: lang=deleted; expires=Mon, 16-Mar-2009 15:47:50 GMT; path=/
Set-Cookie: lang=de; expires=Wed, 16-Mar-2011 15:47:51 GMT; path=/
Set-Cookie: lang=deleted; expires=Mon, 16-Mar-2009 15:47:50 GMT; path=/
Set-Cookie: lang=de; expires=Wed, 16-Mar-2011 15:47:51 GMT; path=/
Set-Cookie: lang=deleted; expires=Mon, 16-Mar-2009 15:47:50 GMT; path=/
Set-Cookie: lang=de; expires=Wed, 16-Mar-2011 15:47:51 GMT; path=/
Set-Cookie: lang=deleted; expires=Mon, 16-Mar-2009 15:47:50 GMT; path=/
Set-Cookie: lang=de; expires=Wed, 16-Mar-2011 15:47:51 GMT; path=/
Set-Cookie: lang=deleted; expires=Mon, 16-Mar-2009 15:47:50 GMT; path=/

[.. snipping about 500 more lines ..]

I was now able to fix this issue by changing the code as followed:

file: inc/languages.inc.php

Inside function tryToGetLang()

// check with country
if( checkLangExists( $sLang ) ) {
/* START replace
if( $bSetCookie )
setLangCookie( $sLang );
}
*/

if( $bSetCookie && ($_COOKIE['lang'] != $sLang) && (SH_LANG_SET != $sLang) ){
define("SH_LANG_SET",$sLang);
setLangCookie( $sLang );
}
//EOF replaced

return $sLang;
}

//drop country
list( $sLang, $sCntr ) = explode( '-', $sLang, 2 ); // en-us => en
if( !$sLang or !$sCntr ) continue; //no lang or nothing changed

//check again. without country
if( checkLangExists( $sLang ) ) {
/* START replace
if( $bSetCookie )
setLangCookie( $sLang );
*/

if( $bSetCookie && ($_COOKIE['lang'] != $sLang) && (SH_LANG_SET != $sLang) ){
define("SH_LANG_SET",$sLang);
setLangCookie( $sLang );
}
//EOF replaced

now, the cookie is only being set, if it's not set already:

Set-Cookie: lang=deleted; expires=Mon, 16-Mar-2009 15:49:30 GMT; path=/
Set-Cookie: lang=en; expires=Wed, 16-Mar-2011 15:49:31 GMT; path=/

hope, this might be helpful for the one or the other ;-)

Quote · 16 Mar 2010

I got the same error. I solved it with with the changes you gave us(thks), but what does this changes affect further? Does the page load slower?

This issue is not fixed in 7.0.2 but why are we the only ones that get this error, is that not a bug? I made a clean install on an other domain and I didn't get this error (without changing languages.inc.php), why?? where could be the main problem??? 

 

thks

 

Quote · 25 Sep 2010

Thank you for the report and fix!

Ticket: http://www.boonex.com/trac/dolphin/ticket/2182

Changeset: http://www.boonex.com/trac/dolphin/changeset/14458

Rules → http://www.boonex.com/terms
Quote · 27 Sep 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.