Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

BlazeDS Flex Session Issue


Level 1
Hi All,

I face an issue in using
flex.messaging.FlexSessionfor handling sessions. Your help
is deeply appreciated.

During user login i use the following line of code to store
to user name in the session.

FlexSession userSession= FlexContext.getFlexSession();

userSession.setAttribute("userid", userid );

When user logs out i use the following line of code to
invalidate / destroy session.

FlexSession userSession= FlexContext.getFlexSession();


All the server logic is handled by remoteObject (java).

Issue : When "user1" logs in for the first time and then logs
out the session in the server is not invalidated even if
session.invalidate is called.

This behaviour was verified when i used another user to log
in but was able to see the previous username reflected in the
welcome page when i user session.getAttribute("userid");

Why is the session not invalidated in spite of it
session.invalidate call is made..

Please help!!!



2 Replies


Level 2

Assuming that the session.invalidate() is not working.
FlexContext.getFlexSession() should be returning the session object
for the new user and not the object of the old user who logged off,
more over when another user logs in, shouldn't the
userSession.setAttribute("userid", userid) be overwriting the value
with new userId ??

Can you please check out if something else is going wrong.

Hope this helps.


Level 1
Hi SujitG,

Thanks for your response. The issue is resolved and the
mistake was mine. I used flex from the view point of traditional
web programing. On loading a flash page i used the onCreate event
to call the Remote object behind to retrieve the user name. So when
i sign out and sign in as different user , since the call was made
on the Page onCreate event the RO call is not made again to
retrieve the new user name. So i called the RO once the user signed
in and i could see the signed in user name reflected in the flash

Thanks for your response again.


So FlexSession in deed works fine and i