views:

1089

answers:

1

I have a system that uses a meta refresh to a logout page, which cleans up after idle users. (Don't worry, the server also times out the session)

I started doing some operations via ajax (not really xml, but that's beside the point). I can run javascript returned from the async request, so I'm wondering if it's possible to reset the meta refresh on the page so that it has a longer timeout. The usual setTimeout calls just add a new timeout, but do they replace the meta timeout?

+4  A: 

No. The meta tag is interpreted when the page loads as though it were an actual HTTP header, and post-load changes have no affect on it.

You're better off ditching the meta refresh, and relying entirely on JavaScript to reload the page when appropriate. If you must support clients without scripting, then default to a no-script page utilizing meta refresh combined with a JS redirect to script-enabled (meta refresh free) page for users who can take advantage of it.

Shog9