سؤال

I have a sample application using Flex and Java using of Blazeds.

How can I provide session to a particular user? For example one user can log in to the application, then if same user copy the url into new tab of the same browser then it asks for login again.

هل كانت مفيدة؟

المحلول

Providing session in java side is Better..

نصائح أخرى

would you not be able to use a cookie to handle session management, its possible that the cookie is not being correctly set with the session ID.

if you are handling session in flex and java then you need to make a remote object call to your java class and check whether session contain some value or not.

public String getUser(){
 String status="";
 if(session!=null){
System.out.println(session.getId());
status= (String)session.getAttribute("uname");
}else{
session = FlexContext.getFlexSession();
status=null;
 }
return status;
}

in Flex check the result of this method is null or not if its not null then fine else navigate to your login page this way you can approch to session handling in flex.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top