As I understand it, you want that even after logging in, if you enter the following login URL:
http://localhost:8080/web/guest/home?p_p_id=58&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&saveLastPath=0&_58_struts_action=%2Flogin%2Flogin
then you must be delivered to the home page, that is, at http://localhost:8080/web/guest/home .
So, if that is the case, I think you can create a -filter hook servlet that intercepts all requests and checks the corresponding URL parameters, for example struts_action=/login/login , and does the following (in psuedo code):
if(is_SignIn_URL) { // check if it is the sign-in URL if(isUserLoggedIn) { // check if user is logged-in // redirect to the home page configured in portal-ext.properties } else { // let the application work normally ie let it go to the sign-in page } }
Also for information and in-depth understanding, you can check the lifeary AutoLoginFilter class (this is the actual servlet filter, but you can hook along the same lines) and liferay-web.xml for the URL c/portal/login , which will lead you to the home page, if the user is logged in or takes you to the login page.
And it does not depend on the use of cookies :-)
source share