Changed the session invalidation
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerCore@81464 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8ac030e295
commit
ab09ca9721
|
@ -96,7 +96,7 @@ public class ASLSession{
|
|||
public long getSessionTimeoutMillis() throws IOException, ParserConfigurationException {
|
||||
if(sessionTimeout > 0) //means that is already set to a value !
|
||||
return sessionTimeout;
|
||||
int timeoutSecs;
|
||||
int timeoutMins;
|
||||
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder dBuilder = null;
|
||||
try {
|
||||
|
@ -113,10 +113,10 @@ public class ASLSession{
|
|||
String timeoutString = sessionTimeouts.item(0).getTextContent(); //timeout now contains the timeout value in string. eg "400"
|
||||
if( (timeoutString==null) || (timeoutString=="")){
|
||||
logger.debug("No property session-timeout in file, setting it to default");
|
||||
timeoutSecs = 1800; //30 minutes
|
||||
timeoutMins = 30;
|
||||
}
|
||||
else{
|
||||
timeoutSecs = Integer.parseInt(timeoutString);
|
||||
timeoutMins = Integer.parseInt(timeoutString);
|
||||
}
|
||||
}
|
||||
catch (Exception e) { //case tomcat properties file could not be found
|
||||
|
@ -130,20 +130,20 @@ public class ASLSession{
|
|||
String timeoutString = sessionTimeouts.item(0).getTextContent();
|
||||
if( (timeoutString==null) || (timeoutString=="")){
|
||||
logger.debug("No property session-timeout in local file, setting it to default");
|
||||
timeoutSecs = 1800; //30 minutes
|
||||
timeoutMins = 30;
|
||||
}
|
||||
else{
|
||||
timeoutSecs = Integer.parseInt(timeoutString);
|
||||
timeoutMins = Integer.parseInt(timeoutString);
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
logger.debug("Could not parse file properties.xml for property. Setting it to default.");
|
||||
timeoutSecs = 1800; //30 minutes
|
||||
timeoutMins = 30;
|
||||
}
|
||||
}
|
||||
//At this point, in all cases "timeoutSecs" will have a valid timeout value. If not from the two xml files, then a default one
|
||||
logger.info("Session Timeout is: " + timeoutSecs*1000);
|
||||
sessionTimeout = timeoutSecs * 1000;
|
||||
return timeoutSecs * 1000;
|
||||
sessionTimeout = timeoutMins * 60000; //in milliseconds
|
||||
logger.info("Session Timeout is: " + sessionTimeout);
|
||||
return sessionTimeout;
|
||||
}
|
||||
|
||||
|
||||
|
@ -245,7 +245,7 @@ public class ASLSession{
|
|||
maxTime = getSessionTimeoutMillis();
|
||||
} catch (Exception e) { e.printStackTrace();}
|
||||
|
||||
lastUsedTime = System.currentTimeMillis() - maxTime+120000; // 2 minutes excessive
|
||||
lastUsedTime = System.currentTimeMillis() - maxTime - 120000; // 2 minutes excessive
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<session-config>
|
||||
<session-timeout>400</session-timeout>
|
||||
<!-- session timout in minutes -->
|
||||
<session-timeout>30</session-timeout>
|
||||
</session-config>
|
||||
</properties>
|
Loading…
Reference in New Issue