SessionTime Out not working

7
We'd tested sessionTimeOut with local and test environment which is 1 node, but after deploy it on the production with load balancer and two nodes it works but also it was noticed after few days the sessionTimeout not working any more. *We are not sure if this was because two nodes.   The soluation was to set the following Custom Settings: SessionTimeout : 600000 EnableKeepAlive : false    
asked
2 answers
2

Hello Ahmad,

  Does your load balancer have sticky sessions enabled?  That is one of the requirements for High Availability Architecture that use load balancers.

answered
0

We have sticky sessions within our environment as well. We found that we also had to use the Idle timer widget and configure a microflow that calls a LogoutUser java action in order for it to work properly. 

IDLE TIMER

 

LOGOUT MICROFLOW

 

Java Action

public class LogoutUser extends CustomJavaAction<Boolean>
{
    private Boolean logout;

    public LogoutUser(IContext context, Boolean logout)
    {
        super(context);
        this.logout = logout;
    }

    @Override
    public Boolean executeAction() throws Exception
    {
        // BEGIN USER CODE
        if (this.logout)
            com.mendix.core.Core.logout(getContext().getSession());
        return true;
        // END USER CODE
    }

    /**
     * Returns a string representation of this action
     */
    @Override
    public String toString()
    {
        return "LogoutUser";
    }

    // BEGIN EXTRA CODE
    // END EXTRA CODE
}
 

answered