フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
William Gosse
Liferay 6.1 and virtual host issue
2012/05/14 12:33
答え

William Gosse

ランク: Regular Member

投稿: 108

参加年月日: 2010/07/04

最近の投稿

Please see http://www.liferay.com/community/forums/-/message_boards/message/13908890 for details

I just examined my tomcat access log and I'm seeing the following:

On my first sign in attempt, which fails, I have this log entry:
76.118.185.83 - - [13/May/2012:09:19:24 -0400] "POST /home;jsessionid=E21D703049C3A24C1E825B1A162D5F76?p_auth=ZhsiMJe1&p_p_id=58&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&saveLastPath=0&_58_struts_action=%2Flogin%2Flogin&_58_doActionAfterLogin=false HTTP/1.1" 404 654

On my second sign in attempt, which suceeds, I have this log entry
76.118.185.83 - - [13/May/2012:09:20:18 -0400] "POST /home?p_auth=ZhsiMJe1&p_p_id=58&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&saveLastPath=0&_58_struts_action=%2Flogin%2Flogin&_58_doActionAfterLogin=false HTTP/1.1" 302 -

The placement of the jsessionid in the first attempt is the only difference I see.

These are the default settings around cookies in the portal.properties file:
#
# 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 enable sessions when cookies are disabled. See
# LEP-4787. This behavior is configurable because enabling it can break
# certain setups.
#
session.enable.url.with.session.id=true

It seems like the session.enable.persistent.cookies=true is being ignored. I wonder if jsesion is hardcoded in some places by mistake. I see that there were issues with this in the past.

I googled liferay and jsessionid and see some tickets about this issue but they are for older version, but old bugs sometimes have a way of coming back and haunting you sometimes.

I think I just solved the problem by session.enable.url.with.session.id=false however this solution then forces my users to have cookies enbaled.
William Gosse
RE: Liferay 6.1 and virtual host issue
2012/05/14 12:06
答え

William Gosse

ランク: Regular Member

投稿: 108

参加年月日: 2010/07/04

最近の投稿

I was hoping I could get a Liferay guru to respond to this post so I can confirm that its a legitimate problem or not.

Thanks in advance.
Mika Koivisto
RE: Liferay 6.1 and virtual host issue
2012/05/15 12:25
答え

Mika Koivisto

LIFERAY STAFF

ランク: Liferay Legend

投稿: 1498

参加年月日: 2006/08/07

最近の投稿

In the first request it has to use the jsessionid from url because it doesn't yet know if you have cookies enabled on your browser. It's also recommended to have session.enable.url.with.session.id=false because having jsessionid in the url leads to bad SEO and make session hijacking more possible.
William Gosse
RE: Liferay 6.1 and virtual host issue
2012/05/15 14:53
答え

William Gosse

ランク: Regular Member

投稿: 108

参加年月日: 2010/07/04

最近の投稿

Thanks for your response.

I'm still curious why I don't see this reloading of the home page behavior on the first sign in or create account attempt in 6.05.
Krzysztof Gołębiowski
RE: Liferay 6.1 and virtual host issue
2013/07/29 2:28
答え

Krzysztof Gołębiowski

ランク: Expert

投稿: 379

参加年月日: 2011/06/25

最近の投稿

I have the same problem in Liferay 6.1.1 CE GA2. Project I'm working on currently has a few sites (different domains) where authentication is served by Jasig CAS. When user is visiting virtual host (VH are set for private pages, login is required) for the first time, he is not redirected to CAS login form, but standard Liferay login portlet is displayed. I can disable URL jsessionid, but this is not the proper solution.

Maybe you managed to fix this issue already?

Regards,
KG
Krzysztof Gołębiowski
RE: Liferay 6.1 and virtual host issue
2013/07/29 3:52
答え

Krzysztof Gołębiowski

ランク: Expert

投稿: 379

参加年月日: 2011/06/25

最近の投稿

I found solution for my problem. It turned out, that my first and only public page was not accessible for guest (although Virtual Host is set only for private pages). At first visit Liferay displayed message "You don't have access to this page" (which unfortunately was hidden by our theme) instead of redirecting to CAS.

It works now, but I think it is not demanded behaviour. After getting to CAS-secured private site, Liferay at first redirects user to first default public page and then to CAS. If user is not permitted to view this page - he ends up with permission error.

Regards,
KG