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!
Comment | File | Size | Author |
---|---|---|---|
#4 | session_cookie-1243286-4.patch | 2.58 KB | Devin Carlson |
#1 | session_cookie-1243286-2.patch | 2.11 KB | jbylsma |
Comments
Comment #1
jbylsma CreditAttribution: jbylsma commentedPatch file
Comment #2
cappadona CreditAttribution: cappadona commentedJust applied the patch and can't believe my eyes...thanks for saving me from redirection hell :)
Comment #3
yashadev CreditAttribution: yashadev commentedComment #4
Devin Carlson CreditAttribution: Devin Carlson commentedRerolled the patch from #1 and added an update function to remove the
mobile_tools_cookie_lifetime
variable if it was already set somehow.Comment #5
Devin Carlson CreditAttribution: Devin Carlson commentedCommitted to 6.x-2.x.
Comment #6
jbylsma CreditAttribution: jbylsma commentedThank you!