Web form session timeouts on Android kiosk tablets: workaround for WebView limitations
Android
Title: Web form sessions time out in Android kiosk apps — fix WebView dropsWhen users submit web forms on Android kiosk tablets, the submission fails or the session has already expired, even though the same form works without issues on Chromebooks.
Why this happens
Android WebView — the component that renders web content inside kiosk apps — manages sessions differently from a full browser. If the device screen locks, the app moves to the background, or the form sits idle for several minutes, the server-side session can expire or the WebView connection can drop silently. Unlike Chrome on Chromebooks, WebView does not send the background keep-alive signals that many web servers rely on to maintain an active session.
Before you begin
Confirm all of the following are true before proceeding:
- Affected devices are running in kiosk mode with a web-based form application.
- The issue occurs on multiple devices across multiple Wi-Fi networks — ruling out a single device or network fault.
- The same web application completes form submissions successfully on Chromebooks or desktop browsers.
How to fix WebView session timeouts
Choose one or more of the following options based on your setup. Option 1 and Option 2 are the most reliable long-term fixes and can be combined.
-
Add a server-side session keep-alive (recommended). Ask your web application developer to implement a JavaScript keep-alive that sends a lightweight request to a dedicated server endpoint every few minutes while the form is open. This prevents the server from expiring the session due to inactivity. The exact implementation depends on your server stack, but the pattern is a recurring
fetch()orXMLHttpRequeston a short interval (typically every 2–4 minutes). -
Add a client-side inactivity reload timer. Ask your web application developer to add the following JavaScript to the form page. It reloads the page automatically after a defined period of inactivity, recovering any dropped session before the user attempts to submit.
Adjust the value// Reload page after 10 minutes of inactivity let idleTimer = setTimeout(() => location.reload(), 600000); document.addEventListener('touchstart', () => { clearTimeout(idleTimer); idleTimer = setTimeout(() => location.reload(), 600000); });600000(milliseconds) to match your session expiry window. For example, use300000for a 5-minute timeout. - Configure the kiosk app to relaunch on device wake. When the screen turns off and back on, a dropped WebView session can be recovered automatically if the kiosk app relaunches cleanly. In the Esper Console, navigate to Blueprints → Kiosk Settings → Kiosk App and enable launch on boot and launch on screen unlock. Save the blueprint and deploy it to your affected devices. This reduces the window in which an expired session can go undetected.
- Replace the third-party browser or WebView wrapper with a managed browser app. If your kiosk app uses a custom WebView wrapper or an unmanaged third-party browser, switching to a managed browser application gives your developers more control over session handling, caching, and reload behavior. In the Esper Console, navigate to Apps & Configuration → Apps, add the managed browser application, and deploy it to your device group. Reconfigure your kiosk Blueprint to launch the new app.
If this doesn't resolve it
If session timeouts continue after implementing a keep-alive and configuring the kiosk relaunch settings, gather the following before contacting Esper Support:
- The name and version of the kiosk application or WebView wrapper in use.
- Your web server's configured session expiry duration.
- A screen recording or description of exactly when the timeout occurs (idle period, screen lock, background event).
- Device logs exported from Devices & Groups → [Device Name] → Activity Feed.
Contact Esper Support with the above information so the issue can be investigated further.
Still need help?
If the steps above don't resolve the issue, submit a support ticket with your device model, Android version, Esper Agent version, and a description of what you've already tried — this helps the support team investigate without a follow-up.
Please sign in to leave a comment.
Comments
0 comments