MC wrote on 22 mrt 2008 in comp.lang.javascript:
[Please do not toppost on usenet]
I have to say your wrong. A javascript can track every time a page
loads, and knowing the session timeout, calculate an approximate,
hopefully +- less than one second, session timeout.
No it cannot, as there could be another call in that session resetting
the sererside timeout counter.
Clientside cannot know that, unless it pols the server by ajax or alike
to ask the present value of the timeout counter. Under ASP it is not even
available, I suspect the same goes for PHP, but I don't know.
I would like to, given a timeout such as 30 minutes, have a countdown
from the onload event. It would then be nice to prompt the user to
logout or continue the session by sending a message back to the server
to refresh the session.
You cwertainly can do that, but it does not reflect the session state.
I say your wrong, because session timeouts ARE being done currently in
many websites such as banks.
Those sites heavily rely on serverside, I hope.
...and I never suggested Google write my
code, but that Google search find an appropriate example.
You did not suggest anything of the sort, though I might be what was in
your mind. You only said Google had failed you. If that was about
searching and not about the share value, it could also be that your
searching skills were not perfect. How would we know?
Please troll someplace else if you have nothing constructive to add.
So now you become abusive, thinking this NG is your personal helpdesk and
by asking Qs you have a right to dictate the answers?
My aswer was constructive, showing you you asked the wrong Q an prompting
you to a better one.
A countdown timer in Javascript, you simply could have asked for that,
is a simple affair, can be written within 10 minutes. But you did not ask
for that.
If you stay polite, maybe someone will help you.