Portal 6.0 Preferred Local not updated if user logged into two sessions

I have a button to let the user switch locale from en_US to ja_JP and back. My custom provider changes the preferredlocale and then logs the user out and back in. This works correctly as long as the user has only one browser open.

I'm using this kind of language override to customize the channels/portlets:

<Locale language="ja" country="JP" advanced="false" merge="fuse" lock="false" propagate="true">

..... japanese content here....

</Locale>

The problem occurs when the user has more than one session such as when the user has two browsers open. When there are two sessions open then neither one can switch the language. In the console the preferredlocale gets updated and the user is logged out and back in per my provider's instructions but the language in the channel gets stuck on the last language it was displaying.

The problem goes away when a logout occurs on one of the sessions. After that, the remaining session can change the language just fine.

Is there a way to force a logout of all sessions associated with a login id?

Any other ideas on how to solve this problem?

-Dave

[1173 byte] By [daveleathers2] at [2007-11-25 19:23:10]
# 1

Single session enforcement will be out of box feature on Access Manager 7 coming with Java Enterprise System4. Current schedule will be around sept-oct 2005.

If you want to do it now, please take a look of AM development manual regarding session checking under sdk by yourself in your own code. Jerry

jh23093 at 2007-7-3 23:42:26 > top of Java-index,Web & Directory Servers,Portal Servers...
# 2

When I change my language using the Sample UserInfo channel, the langage takes effect immediately for the localized jsps in /etc/opt/SUNWps/desktop/default/ but it does not take effect for the locale tag in the channel provider xml until after I log out and back in:

<Channel name="News" provider="JSPProvider" merge="replace" lock="false" advanced="false">

<Properties merge="fuse" lock="false" propagate="true" advanced="false" name="_properties">

<Locale language="ja" country="JP" advanced="false" merge="fuse" lock="false" propagate="true">

... japanese content here....

</Locale>

</Properties>

</Channel>

How can I work around this problem? It's odd that the localized jsp's work immediately but the localized xml configuration doesn't. I can force the user to log out and back in but then I run into the 2 session issue described in my previous post.

daveleathers at 2007-7-3 23:42:26 > top of Java-index,Web & Directory Servers,Portal Servers...
# 3

User profile will not update until you logoff and relogin to load back. If you run userifo channel, it actual re-runs your jsp. If you put into xml display profile, it has already cached in. No dynamic update until you logoff and relogin to reload display profile. Let me check whether you can dynamic update DP. Jerry

jh23093 at 2007-7-3 23:42:26 > top of Java-index,Web & Directory Servers,Portal Servers...
# 4

Try Accessing Channels Directly

You can access the your channel directly at the following URL: http://server:port/portal/dt?provider=JSPDynamicSingleContainer&JSPDynamicS ing

leContainer.selectedChannel=YourXXX&last=false&action=content

Also, look the necessary changes for jsp list ed below.

More detail, see http://docs.sun.com/app/docs/doc/817-7694 page 103. Jerry

jh23093 at 2007-7-3 23:42:26 > top of Java-index,Web & Directory Servers,Portal Servers...
# 5
JSPDynamicSingleContainer is missing in my install of Portal 6.0. Where can I get it?
daveleathers at 2007-7-3 23:42:26 > top of Java-index,Web & Directory Servers,Portal Servers...
# 6
I checked my JES3 2005Q1 Portal 6.3.1 installation. It has JSPDynamicSingleContainer under /etc/opt/SUNWps/desktop/default as well as sampleportal. Check your own installation. Jerry
jh23093 at 2007-7-3 23:42:26 > top of Java-index,Web & Directory Servers,Portal Servers...
# 7

It sounds like I have two approaches to attempt to solve the language caching issue.

1. I extend JSPProvider to get the language specific attributes dynamically and avoid the caching problem. This means that I can't use the build in locale functionality (the <Locale> tags).

This seems the easiest method but I'd like to use the built in <Locale> functionality if at all possible.

2. I find a way to logout all the user's active sessions.

Method number 2 doesn't seem to work because the following code snipits returns zero results:

Session session1 = Session.getSession(new SessionID(request));

out.print(session1.getValidSessions().size());

output 0 -

SessionService ss = SessionService.getSessionService();

Vector myvect=ss.getValidSessions(session1);

out.print(myvect.size());

output 0 -

daveleathers at 2007-7-3 23:42:26 > top of Java-index,Web & Directory Servers,Portal Servers...