M.A.M
M.A.M

Reputation: 63

How to override moqui session timeout with transition or service-call

I want to override moqui session timeout on transition execution. moqui default session configured in the web.xml like this

<session-config>
    <!-- session timeout in minutes; note that this may be overridden with webapp.session-config.@timeout in the Moqui Conf XML file -->
    <session-timeout>600</session-timeout>
    <cookie-config><http-only>true</http-only><comment>__SAME_SITE_LAX__</comment></cookie-config>
    <tracking-mode>COOKIE</tracking-mode>
</session-config>

But I want to change the session-timeout value when the transition is executed on the page, when method sessionCreated in class MoquiSessionListener is executed, the value of session timeout set in this method

@Override void sessionCreated(HttpSessionEvent event) {
    HttpSession session = event.session
    ExecutionContextFactoryImpl ecfi = (ExecutionContextFactoryImpl) Moqui.getExecutionContextFactory()
    String moquiWebappName = session.servletContext.getInitParameter("moqui-name")
    ExecutionContextFactoryImpl.WebappInfo wi = ecfi?.getWebappInfo(moquiWebappName)
    if (wi?.sessionTimeoutSeconds != null) session.setMaxInactiveInterval(wi.sessionTimeoutSeconds)
}

also, this class(MoquiSessionListener) has been added to MoquiDefaultConf.xml as listener

<!-- Moqui Session Listener (necessary to handle expired sessions, etc) -->
        <listener class="org.moqui.impl.webapp.MoquiSessionListener"/>

is there a way to change the value of the session timeout when moqui framework is running and transition or service-call is executed?

Upvotes: 0

Views: 61

Answers (1)

G M
G M

Reputation: 1

You will make changes in /runtime/conf/MoquiDevConf.xml,MoquiProductionConf.xml,MoquiLoadTestConf.xml whichever file using make changes in anyone file whichever you are using and put sample Screenshot for example

Upvotes: 0

Related Questions