0
votes

Our application has been developed on Liferay with multiple Spring MVC portlets on the page. Its a single page application, and the navigation only happens inside the portlets. Now sometimes when Liferay session times out and I send a request to the control for a new view, the liferay login page is being shown inside the portlet. But the expected behaviour is if the liferay session is timed out, then the whole page should have redirected to Login page. I have specified following properties in the portal-ext.properties

session.timeout.warning=1
session.timeout.auto.extend=false
session.timeout.redirect.on.expire=true
browser.cache.signed.in.disabled=true

Any suggestions?

2
Try adding in auth.login.url=/web/guest/home in portal-ext.properties where your login portlet is dropped.Parkash Kumar

2 Answers

0
votes

If you're just doing Ajax navigation in the portlets, you might want to hook into Liferay's session-extension way (you'd have to look it up - there's a client side timer that counts down and displays the "session.timeout.warning" - I can't give pointers right now)

Alternatively, if a session extension is acceptable as long as a browser window is open, you can use the same mechanism to show an alternative behaviour: Instead of willingly timing out a session, it can extend the session. See portal(-ext).properties:

#
# Set the auto-extend mode to true to avoid having to ask the user whether
# to extend the session or not. Instead it will be automatically extended.
# The purpose of this mode is to keep the session open as long as the user
# browser is open and with a portal page loaded. It is recommended to use
# this setting along with a smaller "session.timeout", such as 5 minutes for
# better performance.
#
session.timeout.auto.extend=true
0
votes

Does this happen in all your pages or only on specific pages. ? Does this happen on click of any button?

If so , do the following in the method that you are calling on the click of the button,

function onClickFunction(){
 var liferaySession = Liferay.Session._currentTime;
 if(liferaySession == '0'){
   //reload page
  }
 else{
   //proceed
  }
}