Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
rhache CreditAttribution: rhache commentedI'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
Comment #2
rhache CreditAttribution: rhache commentedI'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
Comment #3
kat3_drx CreditAttribution: kat3_drx commentedRene,
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().
Comment #4
twom CreditAttribution: twom commentedHi 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!
Comment #5
rhache CreditAttribution: rhache commentedHi twom,
Here are my different settings:
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
Comment #6
twom CreditAttribution: twom commentedHi 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
Comment #7
minorOffense CreditAttribution: minorOffense commentedAssuming the issue is resolved. Please reopen if that is not the case.
Comment #8
rjdempsey CreditAttribution: rjdempsey commentedSorry to re-activate this thread, but I'm experiencing the exact same issue. Except in our case we are using an "m." domain.
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?
Comment #9
bayousoft CreditAttribution: bayousoft commentedI 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.
Comment #10
bmx269 CreditAttribution: bmx269 commentedI to now have this issue. Thanks for sharing Ryan :)
I will see what I can do to resolve this.
Comment #11
Devin Carlson CreditAttribution: Devin Carlson commentedThe issues with sessions were fixed with #1243286: Broken session cookie (w/patch).
Comment #12
rebecca.miller CreditAttribution: rebecca.miller commentedI 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.
Comment #13
chido0075 CreditAttribution: chido0075 commentedI had the same problem, but got it fixed by logging out... And then back in.
Comment #14
apadernoI am closing this issue, as it's for a Drupal version no longer supported.