Actually we dont have a sessions in flex side .. we have a shared objects in flex and that shared objects are like cookies.. the best way to maintain session is FlexContext class..
in java side u need to get the session through FlexContext class.. and assign this to HttpSessions.. i think this will help u .....
u can store the user information in sharedobjects but u can not maintain sessions i think.. above is the best practise...
There is no need for you to create any sessoin in Flex side as Flex applications are functionally a lot more like client-server applications than they are web applications. Like desktop client-server applications, Flex applications are loaded and they remain running as long as the app is in use.
You can check out the below link by reading which you can get a lot out of it.
thank for your reply
but may i know how can i have logout in flex environment when i dont have session.
thanks in advance
There are lot of ways to implement logout ... u can implement logout by removing all child and all catching objects in client side.. and all shared objects.. then
when ever u loged in agin it will not take previous value.. it will take new value.. u can implement logout in this way.. give a navigation to login page and remove every thing childs and modules . and stored objects...
What about showing logout form after timeout the app for 20 minutes of not using the app.
Any examples up there?
You can make use of FlexEvent.IDLE ...
Add the below event listener in either preInitialize or creationComplete of Application.
private function userIdle(e:FlexEvent):void
if(e.currentTarget.mx_internal::idleCounter == parseInt(model.employee.SessionTimeOut) * 600)
In the above 1 min = 600Ticks
model.employee.SessionTimeOut is the dynamic value in minutes...
public function logout():void
var logout:URLRequest=new URLRequest("logout.html");
That works Bhaster, thanks!!