The "Redirection cookie (seconds)" field on admin/settings/mobile-tools/device-detection states:

This field is only used when using the ?device= setting. This is the lifetime of the cookie that determines how long the session is remembered. Choose 0 for only the session.

After trying 0, I saw that a immediately expiring cookie, not a session cookie, was being created. That wasn't quite what I was looking for :) After a little tracing, I noticed that the cookie was attempted to be set using a variable called "mobile_tools_cookie_lifetime," defaulting back to some somewhat broken code for $session_time. Not seeing this referenced anywhere else, I'm guessing this was the mistake.

I've refactored $session_time to allow the creation of session cookies, as well as replaced all the mobile_tools_cookie_lifetime references with $session_time. Everything appears to be working as expected!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jbylsma’s picture

Patch file

cappadona’s picture

Just applied the patch and can't believe my eyes...thanks for saving me from redirection hell :)

yashadev’s picture

Status: Active » Reviewed & tested by the community
Devin Carlson’s picture

Version: 6.x-2.3 » 6.x-2.x-dev
Assigned: Unassigned » Devin Carlson
Status: Reviewed & tested by the community » Needs review
FileSize
2.58 KB

Rerolled the patch from #1 and added an update function to remove the mobile_tools_cookie_lifetime variable if it was already set somehow.

Devin Carlson’s picture

Status: Needs review » Fixed

Committed to 6.x-2.x.

jbylsma’s picture

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.