I installed Mobile Tools and Browscap on my development site and when I try to have a mobile device going to dev.mysite.com redirect to m.mysite.com it just loops through the two and errors out.

It works fine when you go to m.mysite.com.

There was a similar problem in the 6.x version is there any idea if it is going to make it to the 7?

Thanks

Comments

anyr’s picture

I have the same problem, if you clear the cookies it works again for a bit, then stops once you try to switch sites

olofbokedal’s picture

I have this problem when switching user agent using a plugin for Firefox.

It works on a real phone and the iPhone simulator though. Are you guys using Firefox or an actual mobile device?

adamgerthel’s picture

The problem seems to persist. After switching over to desktop once (on an iPhone) I get into a redirect loop. Next time I visit the site, I start out in the loop.

olofbokedal’s picture

This seems to have started since iOS 5. It doesn't happen happen in the iOS simulator that runs iOS 4.3.

olofbokedal’s picture

Status: Active » Closed (fixed)

I've found a solution.

If you're using a different domain for the mobile site (m.example.com), you need to specify the cookie domain in your settings.php file. Otherwise, the device cookie that is deleted when you use ?device=auto, will only be deleted for one of the domains.

Simply put, what you need to do:

  1. In your settings.php file, locate the line that says $cookie_domain = '.example.com';
  2. Uncomment the line and change it to your domain.
emastyle’s picture

Hello, after having a bad experience with Mobile tools module + boost I followed this post http://drupal.org/node/1214890 and configured shared cookie domain but without success... "too many redirecting" error on Iphone.
Any suggestions?
emastyle

kristat’s picture

Make sure you aren't using absolute urls. It appends the www to the front and throws the browser into a redirect loop. I disabled the relative to absolute filter and made sure the views were not using the site url and it resolved all my redirect problems.

lalit774’s picture

i have installed mobile_tools and dependency modules.

i have configure one main domain like mobile.com
second sub domain as usual m.mobile.com

both are working fine if run directly in browser.

but if i put mobile.com in mobile device. it doesn't redirect.

i am using 7.x-2.x-dev version.

is this problem is related with any bug.

i am suing following settings.

General configuration
Mobile URL m.mobile.com
Desktop URL mobile.com

Redirection options

Enable automatic redirection ENABLED

Redirection cookie 0

Theme Switching

When do you want to switch themes

Checked Switch theme based on the URL

Mobile theme Theme Name

Additional mobile specific theming configuration

Checked automatically hide address bar

Iphone/IPAD etc

disable filter to device group
Mobile theme

External Modules

Device detection module

Browsercap

Thats all for admin settings

add following in settings.php

sites/all/default/settings.php
sites/m.mobile.com/settings.php
$cookie='.moble.com';

Please correct me if i have done some wrong settings