Issue
- I'm seeing that the LMDD does not always properly detect a mobile device if I'm using a browser mobile emulator.
In this example, the LMDD app was set up to display mobile device information using the Device Recognition API. The device information is not changing after toggling the browser mobile device emulator.
Environment
- Liferay DXP
Resolution
- This occurs because Liferay caches the device in the session to avoid having to recompute it on every request. Signing in or out of Liferay would trigger a new session and cause Liferay to properly recompute the device information based on the mobile emulator used.
-
In order to not cache the device in the session, set the following property to
false
:
# # Set this property to true to cache the user's device profile to the HTTP # session. If this property is false, then the portal will perform device # detection for each request. # mobile.device.session.cache.enabled=true
Additional Information