[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
problem of forbid login repeatedly in cluster using Terracotta  XML
Forum Index -> Terracotta for Web Sessions
Author Message


Joined: 07/09/2014 05:27:29
Messages: 1

I made a cluster of small normal web application(run in Tomcat 7.x) and used Terracotta Server Array 3.7.7.Session-replication is successful.
Now I want to solve the problem of "login repeatedly", that means:if a user had login into application successfully, then the user(accout) shouldn't login in other place until last online session logout.
At first, I had an idea with using ServletContext:when a user has login first time,put current session into ServletContext with ServletContext.setAttribute method using the user'id as attribute name,so when the user try login second time in other place I can check from ServletContext attributes whether the user's id had a corresponding session, and get the old session if it exists, and call its invalidate method,then put the new session into ServletContext.But after having a try of this scheme I found that ServletContext is not be replicated by Terracotta.So I failed.
Then I had another idea of using DSO:I create a java class with Hashtable-type field,add user's id and the old session into it like using ServletContext attributes,and share the class instance in cluster with DSO.But I failed again because Terracotta 3.7.7 seemed do not support DSO any longer.
Is here any master can help me?Thanks a lot!
Forum Index -> Terracotta for Web Sessions
Go to:   
Powered by JForum 2.1.7 © JForum Team