I have an HTML5 app setup; when the browser is closed, the session ends. When I re-open the app, the app detects the session is invalid, and prompts the user to login again. This is all fine.
However, when the user is redirected back to the page, their old session information is still cached:
sforce.connection.sessionId = '{!$Api.Session_ID}';
Thus, the application still sees the old session and thinks the app is offline, even though the user has a new session and is online.
Is there a way to reset the sessionId dynamically on the cached page?