https://bugzilla.wikimedia.org/show_bug.cgi?id=54885

Kelson [Emmanuel Engelhart] <kel...@kiwix.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---
            Summary|MobileFrontend doesn't      |MobileFrontend doesn't
                   |remember user choice        |remember user choice
                   |(mobil/desktop)             |(mobil/desktop) in some use
                   |                            |cases
     Ever confirmed|0                           |1

--- Comment #7 from Kelson [Emmanuel Engelhart] <kel...@kiwix.org> ---
I have investigated a little bit and the problem is related to the
"stopMobileRedirect" cookie.
The reaon is that the domain is wrong in with "exotic" setups (so the cookie
does not apply).

For example if:
* The server name has more than 3 parts (like wiki.wikimedia.org.uk) and you
don't have setup $wgMFStopRedirectCookieHost.
* You access the server under an other address like specified in
$wgMFStopRedirectCookieHost

In a try to fix this I can propose following changes to MobileContext.php.
$ diff MobileContext.php.back MobileContext.php
473,477c473
<             $domainParts = explode( '.', $host );
<             $domainParts = array_reverse( $domainParts );
<             // Although some browsers will accept cookies without the initial
., ยป RFC 2109 requires it to be included.
<             wfProfileOut( __METHOD__ );
<             return count( $domainParts ) >= 2 ? '.' . $domainParts[1] . '.' .
$domainParts[0] : $host;
---
>                         return substr( $host, strpos( $host, "." ) );
493c489
<         if ( !$wgMFStopRedirectCookieHost ) {
---
>               if ( !$wgMFStopRedirectCookieHost || 
> $wgMFStopRedirectCookieHost != $this->getRequest()->getHeader( 'Host' ) ) {

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to