On any mobile device, in the recommended and in the latest 6.x dev version, if I go to any URL on my site with "?device=desktop" appended, it goes to the desktop version, but then when I try to go back to the mobile version, it simply will not work. Device detection no longer works; I go to /gomobile, I go to ?device=gomobile, I set the session cookie to "0," I end my session, I clear every cache possible, local and system, and nothing works. This is terribly frustrating and is actually keeping us from being able to use this module going live. Help, please!

Comments

rhache’s picture

I'm getting the same issue as kat3_drx.

After clicking the "View Full Site" link from Mobile Tools, I cannot switched back unless I clear both the cookies and cache for Safari on my iPhone.

Once on the desktop version, the link remains "view full site". The URL is appended with the ?device=desktop. I was thinking that just removing that bit might force the site to go back to mobile mode, but it doesn't change anything.

I'm mainly using Panels for landing pages and Context for placing blocks, wondering if that has any impact?

Sincerely,
Rene

rhache’s picture

I'm wondering if part of the issue is that I do not need any redirection between mobile and desktop sites, ie both are set to use the same domain.

Could that confusing mobile tools somehow?

In my mobile tools settings, I've go the "Enable automatic redirection of the mobile user" option checked on, and set the Redirection cookie (seconds) option to zero.

After a bit more testing, I'm also noticing that clearing the cookies on mobile Safari is enough to fix the issue. Clearing the site or browser cache doesn't seem to have any impact.

Thanks,
Rene

kat3_drx’s picture

Rene,

I noticed that clearing the cookies in Safari mobile works too, and that setting "?device=mobile" will send it back to mobile without having to clear the cache, but this also appears to only work on the front page, the inner pages get the same url() method error as mentioned in #1105750: Call to undefined function url().

twom’s picture

Status: Active » Needs work

Hi all,

There are some caveats in using the 'View full site' and 'View mobile site' functionality...

If you are using www.domain.com and m.domain.com as urls, make sure that you set the cookie domain in your settings.php file to

$cookie_domain = ".domain.com"

The main problem could be is that your cookie is set for www.domain.com and m.domain.com seperately.

Can you give me feedback after making sure the $cookie_domain is being set?

It is also good to know your settings:
- do you use seperate urls
- did you enable redirection
- what setting did you choose in your theme settings

Thx!

rhache’s picture

Status: Needs work » Active

Hi twom,

Here are my different settings:

  • Redirection: "Enable automatic redirection of the mobile user" is on and cookie set to 2592000, no exceptions
  • The mobile and desktop URL is the same. I was hoping to use panels and context to do the content adaptation and switching, without resorting to using an "m." domain.
  • I've set the cookie domain in my settings.php.
  • "Switch theme for a mobile device" is enabled, and the same theme is being used for all mobile devices. "Automatically hide address bar in mobile theme" and "Add Mobile Tools header" options are also enabled.

So the only thing I changed after seeing you comment is the cookie in settings.php, which hasn't changed anything except when I manually append "?device=mobile" to the URL. I'm also creating an "m." subdomain and will be testing that shortly.

Sincerely,
Rene

twom’s picture

Assigned: Unassigned » twom
Status: Active » Needs review

Hi rhache,

Can you disble redirection? If you have the same url for both desktop and mobile sites, then there is no use in using this option.

Some part of the code is dependent on this setting, and at this point there is not check if there is a conflict with:
- redirection enabled
- url's are the same

I guess that now your problem should be fixed!

Let me know if it works.

Tom

minorOffense’s picture

Status: Needs review » Closed (works as designed)

Assuming the issue is resolved. Please reopen if that is not the case.

rjdempsey’s picture

Status: Closed (works as designed) » Active

Sorry to re-activate this thread, but I'm experiencing the exact same issue. Except in our case we are using an "m." domain.

  1. Visitor comes to the site from a mobile device for the first time and is correctly redirected to m.sitename.com
  2. Visitor clicks the "view full site" link and is correctly brought to the desktop site
  3. But on further visits on the same mobile device, they are always brought to the desktop site, unless the "view mobile site" link is clicked.

I'm not using theme switching. I've tried leaving the redirection cookie at default and 0 seconds. I've set the cookie domain in settings.php.

Is this the intended behaviour?

bayousoft’s picture

I am using the same domain with stock settings. Intermittently (I know, still trying to pin it down but I wanted to report this) I can't get back to the mobile version. Clearing Mobile Safari cookies seems to do the trick for me so far as well.

bmx269’s picture

I to now have this issue. Thanks for sharing Ryan :)

I will see what I can do to resolve this.

Devin Carlson’s picture

Status: Active » Closed (fixed)

The issues with sessions were fixed with #1243286: Broken session cookie (w/patch).

rebecca.miller’s picture

Version: 6.x-2.2 » 6.x-2.4
Component: Code » User interface
Assigned: twom » Unassigned
Category: bug » support
Priority: Critical » Major
Status: Closed (fixed) » Active

I have Mobile Tools v. 6.x-2.4 which is supposed to have the Broken session cookie patch. On the Mobile Tools configuration page I have the redirection cookie set to "0." However, when I link to the desktop version of our site, it remembers that the next time I go to the site, even if I close the browser. It is fixed if I clear the cookies, but it would be better if users didn't have to know to clear cookies.

Am I doing something wrong?

Note: We use an m. domain.

chido0075’s picture

Issue summary: View changes

I had the same problem, but got it fixed by logging out... And then back in.

apaderno’s picture

Status: Active » Closed (outdated)

I am closing this issue, as it's for a Drupal version no longer supported.