[Klone-users] Session expire time
Stefano Barbato
barbato at koanlogic.com
Mon Sep 8 05:05:48 EDT 2008
Hi,
On 05/set/08, at 11:39, diakat 2000 wrote:
> Hello,
>
> Stefano wrote in one email: "KLone doesn't really know when a session
> (session_t object) expires."
that's because sessions depends on cookies stored on the clients and
so KLone cannot control them.
> So my questions:
> 1. How can I set the session expiration time? (I found
> DEFAULT_SESSION_EXPIRATION, but I didn't see where I could change the
> time) Maybe there is an entry in the kloned.conf, too?
>
you can overwrite the default value setting the session.max_age key in
the config file:
---[ kloned.conf ]---
...
session
{
type file
# age in seconds
max_age 600
}
...
--------------------
> 2. Can I use the session_age function to check if the session is
> expired? I assume, that after an (old) session is expired, on page
> load the function returns the time of the new session.
when a session expires all variables in it disappear so you can try to
get a known variable and, if it does not exist, create a new session
(the same happens the first time a client fetchs a page from your
webapp).
for example:
------
...
if(session_get(session, "user_logged_in") == NULL)
; /* new user or expired session */
...
-----
s
More information about the klone-users
mailing list