2
votes

i am using liferay 6.1 and created my custom portlet am using liferay login portlet and in that i have some problem while login with the following step..

  • login with user1
  • now open diffrent tab with same url which will automatically login to user1 account in liferay
  • now logout from any of tab and then u will logout from both the tab
  • now from two tab first login with user1 in tab1
  • now do login with user2 from tab2

Now liferay will login with me two diifrent user in same borwser with diffrent tab.(when i refresh the page it will login automcatically with the last user login account) Now what i want is when same user try to login with same browser it will automcatically redirect to user account which login first in tab..

can any body gudide me how to do that??

I have tried with some change in portlet-ext.properties file as follows but didnt succeded

live.users.enabled=true
#
# Set the following to true if users are allowed to have simultaneous logins
# from different sessions. This property is not used unless the property
# "live.users.enabled" is set to true.
#
auth.simultaneous.logins=false 
1

1 Answers

2
votes

This is happening because the browser tabs share the same session through cookies. So you would need to disable cookies for your liferay app in order to use the same browser for different account login. You can set the following properties to false, by default they are true:

#
# Set this to false to disable all persistent cookies. Features like
# automatically logging in will not work.
#
session.enable.persistent.cookies=true

#
# Set this to true to test whether users have cookie support before allowing
# them to sign in.
#
session.test.cookie.support=true

If cookies are disabled liferay would use url-rewriting for maintaining the session, by appending the jsessionId.

I have not yet tried this but I think this should work.