i make a test , i use ie, firefox,google chrome,login a user use one email,and every thing looks ok.no error,no notice,i think this is not friendly,also not easy to and plus,for example ,i need a im chat ,likes facebook, and there is two user && one name ,where the message send to?and so on....
Discuss Development
i found a fun thing .look at here......
You need to be logged in to post messages
By ljx 0517
can i make a colume in datebase named login_sts and this save the state of the user if login or logout?
By ljx 0517
hahaha
hello everyone
I solved this problem
i add this code
//check user is login
String chk_login=(String)context.getServletContext().getAttribute(loginBean.getUsername().toLowerCase());
if("is_login".equals(chk_login))
loginBean.addError("actionError", "please do not login again ");
return "LoginRetry";
}else
context.getServletContext().setAttribute(loginBean.getUsername().toLowerCase(),"is_login");
}
now one user can be login once
By ljx 0517
but once a user close the browser for logout
the user can not login in a hour
There is a SessionListener which uses the com.concursive.connect.cms.portal.utils.Tracker for recording which user is logged in. When the user logs out or the session expires, the Tracker removes the user. You can query the Tracker with ((Tracker) context.getAttribute(Constants.USER_SESSION_TRACKER)).getUserList()
The benefit is that you now have a handle to the user's TrackerElement and sessionId.
Perhaps that can be useful.