View Full Version : How to log out after certain amount of time
pdesignz
03-10-2009, 05:10 PM
I am going through the Security Assist tutorial and had a couple of questions. Is there a way to have the system automatically log out after a certain amount of time. Also once you login is there a way to display the users login name. On other sites I have seen "Welcome, [UserName] & Logout".
Thanks
Danilo Celic
03-10-2009, 08:47 PM
The Authenticate User Server Behavior allows you to set values from the user table into session variables. If it's not present yet, you can add an entry for the user name on step 3 of the Authenticate User Server Behavior wizard. From there, you'd simply need to drag from the Bindings panel the user name onto the page.
The log in for SecurityAssist uses session variables, and the length of time that a session stays "alive" is based upon a server setting, and that would depend on what server language you are using. Some servers may lock this down and not allow changing of the values.
For ASP:
Default time is 20 minutes. You can use something like the following, to set the session timeout to 45 minutes:
<%
Session.Timeout=45
%>
session timeout to 45 minutes
For ColdFusion:
The default is also 20 minutes. To change this, you have to change the sessionTimeout attribute of the cfacpplication tag, something like the following to set your timeout to 45 minutes:
<cfapplication name="ApplicationNameHere"
sessionmanagement="Yes"
sessiontimeout=#CreateTimeSpan(0,0,45,0)#>
For more info, please check the Adobe LiveDocs site for ColdFusion (http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=sharedVars_10.html)
For PHP:
What I've seen is that the default is 24 minutes, and this is set within the php.ini file for your server and can be changed via PHP code if the php.ini file is not locked down by a system admin.
<?php
$garbage_timeout = 2700; // 2700 seconds = 45 minutes
ini_set('session.gc_maxlifetime', $garbage_timeout);
?>
But again, this may be locked down.
HTH
pdesignz
03-11-2009, 07:50 AM
Where would I use the authenticate user behavior, as the tutorial did have us that I am not sure where I would use that. Would I use it on the login page or would it be the index page where you redirected after you login or would be on every page or every page that I want the Username displayed.
Thanks
Ray Borduin
03-11-2009, 07:54 AM
The authenticate user server behavior for Security Assist is used to do the actual login on the login page. It is already applied by the wizard.
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.