in reply to Time Question

Is there any reason you aren't using cookies?

If not, then just send them a cookie with each page:

# major "snip", but you get the idea... my $q = new CGI; my $cookie = $q->cookie(-name=>'timeout', -value=>'session id', -expires=>'+15m'); print $q->header(-cookie=>$cookie);
then just check that cookie exists.

.02

cLive ;-)

Replies are listed 'Best First'.
Re: Re: Time Question
by davis (Vicar) on Dec 04, 2001 at 16:43 UTC
    But remember that cookies are stored by the client, and as such are freely modifiable by that client.
    For this to be safe, I'd recommend sending another cookie which is a one-way hash of the cookie containing the expiration time, and some secret data known only to the server.
    For a bit more on this, check out Encrypted Storage of sensible Data in a Cookie
    A golden rule: *Never* trust the data the client gives you without doing some checks on it.
    Hope that helps.