質問

I need to customize the Liferay 6.0.5 behavior regarding the session timeout. I have 3 community on the same Liferay instance, 2 extranets and an intranet I wish to define a custom timeout for a specific community (on the intranet : no timeout).

I've checked out the session_timeout.jspf file and the session.js script but i can't see how customize it in order to make it work ?

役に立ちましたか?

解決

You may also take a look at the /ROOT/WEB-INF/web.xml, the following part:

<session-config>
    <session-timeout>30</session-timeout>
</session-config>

Also in portal-ext.properties:

session.timeout=30
session.timeout.warning=1
session.timeout.auto.extend=false
session.timeout.redirect.on.expire=true

For a custom handler I would try to modify the \liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\html\common\themes\session_timeout.jspf:

Something like this:

    <c:choose>
      <c:when test="<%= themeDisplay.getScopeGroup().getName().equals("MyCustomCommunity_1") %>">
        <aui:script use="liferay-session">
            Liferay.Session.init(
              {
                autoExtend: false /*my custom value*/,
                timeout: 5 /*my custom value*/,
                timeoutWarning: 0 /*my custom value*/,
                redirectOnExpire: '/web/guest/mycustompage1' /*my custom value*/
              }
            );
        </aui:script>
      </c:when>
      <c:when test="<%= themeDisplay.getScopeGroup().getName().equals("MyCustomCommunity_2") %>">
        <aui:script use="liferay-session">
            Liferay.Session.init(
              {
                autoExtend: true /*my custom value*/,
                timeout: 15 /*my custom value*/,
                timeoutWarning: 1 /*my custom value*/,
                redirectOnExpire: '/web/guest/mycustompage2' /*my custom value*/
              }
            );
        </aui:script>
      </c:when>
      <c:otherwise>
        <aui:script use="liferay-session">
          Liferay.Session.init(
            {
              autoExtend: <%= PropsValues.SESSION_TIMEOUT_AUTO_EXTEND %>,
              timeout: <%= sessionTimeout %>,
              timeoutWarning: <%= sessionTimeoutWarning %>,
              redirectOnExpire: <%= PropsValues.SESSION_TIMEOUT_REDIRECT_ON_EXPIRE %>
            }
          );
        </aui:script>
      </c:otherwise>
    </c:choose>

他のヒント

will the

redirectOnExpire: '/web/guest/mycustompage1' /*my custom value*/

redirect to the specified url, if a user clicks on any of the links or buttons on the page or will it be automatically redirected after the session timeout. In my liferay application, we have several widgets hosted on dashboard page, when a user clicks on any widget it opens a new tab and the widget related info is displayed. When the session times out the widget is opened in new tab but the page is redirected to /web/guest/home , that is the desired behavior. however the dashboard page still remains as the page is not automatically redirected to /web/guest/home after session timeout. how to make the dashboard page redirect to /web/guest/home after session timeout automatically.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top