Setting different landing pages on different cluster nodes upon session timeout

Issue

  • The users have to be redirected to different pages - depending on the nodes -, when the sessions expire.
  • A possible use case: One of the Application Servers is an admin server, thus the admins need to be redirected to a different URL (the admin site), than the regular ones, upon session expiry.

Environment

  • Liferay DXP 7.0
  • Liferay DXP 7.1

Resolution

  • The property below redirects the user to the default page when the session expires, so we can play around with the default home URL of the portal on the nodes to achieve our goal.
    session.timeout.redirect.on.expire=true
  • Let's say on Node 1 you would like to have the following page to be the default landing page:
        Title: admin
        URL: http://localhost:8080/web/guest/admin/ 
    1. Stop the server and set the following properties for Node 1 in portal-ext.properties:
      company.default.home.url=/web/guest/admin/
      session.timeout.warning=0
      session.timeout.auto.extend=false
      session.timeout.redirect.on.expire=true
    2. For Node 2, set the below properties - in this case the original guest home page will be the default landing page:
      company.default.home.url=/web/guest/
      session.timeout.warning=0
      session.timeout.auto.extend=false
      session.timeout.redirect.on.expire=true
    3. Restart the server and verify that Node 1 redirects upon session timeout to the admin page, while on Node 2 the guest home page is loaded after the session expires.
这篇文章有帮助吗?
0 人中有 0 人觉得有帮助