Forum OpenACS Q&A: Session timeout

Collapse
Posted by Ian Boyle on
Hi all,
I'm using OpenACS 4.5 and have the following query.
I'm quite new to OpenaACS, so if I'm missing something very obvious
forgive me.

What do I need to do so that a session times out after N seconds, eg
5 mins(300 secs)?

I've set the following paramaters to low values for test purposes, I
realise these would be too low for the actual site, I'm just trying
using these values to see it working.
eg:
SessionTimeout        20
SessionLifetime        100
SessionSweepInterval  300
SessionRenew          10 ( i.e less that sessiontimeout )

I check for a user_id on the page using ad_verify_and_get_user_id and
use ad_retrunredirect to to to an expired message page. But this
seems to have no effect when the browser is left idle for say 5
minutes, i.e it still finds the user_id. I expected the above
parameters to set user_id to 0.

The above by itself seems to have no effect.
Is there something else I need to do on each page ? do I actually
need to check for a user_id using  ad_verify_and_get_user_id or
something else.

Or is there some other setting I need to have ?

Finally is all of the above carried out by the webserver and cookies
or is the DB involved at all.

TIA
Ian

Collapse
Posted by Lars Pind on
If you have a persistent login cookie, then the session is simply refreshed with the user_id from the persistent cookie.

To get what you want, you need to prevent persistent logins and visit /register/logout to kill the cookie that you have.

Collapse
Posted by Ian Boyle on
That seems to work, thank you very much Lars.
Collapse
Posted by Ian Boyle on
I'm actually still having a problem.

If persistant login is prevented, I presume this is by taking the
-forever option off ad_user_login, how does a user stay logged in for more than the period of the tempory cookie( I'm not sure it this is a tempory cookie or a session) ?

Collapse
Posted by Ian Boyle on
Problem solved, I just needed to restart the webserver after I changed the paramater values.................doh