Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
+1
person also asked this
people also asked this
Replies
19 replies
Subscribers
10 subscribers
Views
17814 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Is there any way to get the list of currently logged in users in the system? Log
Mahesh Sanga
over 10 years ago
Is there any way to get the list of currently logged in users in the system? Login information parser plugin is not useful as the login-audit.csv file does not have the log-out status. Can we build a servlet filter plugin to achive this? or can we use JBoss to track the open sessions? any ideas?...
OriginalPostID-113347
OriginalPostID-113347
Discussion posts and replies are publicly visible
0
Margaret Haymann
Appian Employee
over 10 years ago
did the solution that Eduardo provide not work on this post
forum.appian.com/.../e-112708
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 10 years ago
Here the use case is different, I want to see the number of users who are logged in into the production system at the moment. that post was about how to get the service context for the logged in user!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Margaret Haymann
Appian Employee
over 10 years ago
this post addresses that.
forum.appian.com/.../e-103367
It basically states that you need to use features of the app server to achieve that but does not give details
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 10 years ago
Used JBoss's JConsole to get the active-sessions using the command-> /deployment=suite.ear/subdeployment=web.war/subsystem=web/:read-attribute(name=active-sessions). But I am not sure it returned the right number of active sessions.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 10 years ago
i am using Application server and considering the active session count as number of logged in users. it is leading to a false assumption because if the user closes the window the session would still be alive on the server until the session reaches "session-max-alive-time" period.To achieve this can we implement SessionListeners in any way to get the actual count of logged in users?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
riteshp
over 10 years ago
Quick dirty solution (or may be not) -> Go back to java -> write a Session Listener like below:
public void sessionCreated(HttpSessionEvent se) {
//Creating new session...
activeSessions += 1;
SessionCounterDao.getInstance().pushActiveSessionToDB(se.getSession());
System.out.println("New session Created..." + se.getSession().getId());
}
public void sessionDestroyed(HttpSessionEvent se) {
System.out.print("Destroying... " + se.getSession().getId());
SessionCounterDao.getInstance().popDestroyedSessionFromDB(se.getSession());
if (activeSessions > 0) {
activeSessions -= 1;
}
System.out.println(" --> Destroyed");
}
You have now SPRING_SECURITY_CONTEXT there
String springSecContext = (String)session.getAttribute("SPRING_SECURITY_CONTEXT"); /* geeting all sesision info here */
Enjoy!!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 10 years ago
Thanks Ritesh! does this work like an appian plugin? or do we need to configure this plugin anywhere else?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
riteshp
over 10 years ago
No, It is not aplugin. it is a basic "Session Listener" for appain, nothing else. will update your db with user's sessions with all required information i.e. session creation + last access time + destroy time and additionally SPRING_SECURITY_CONTEXT value. So, now use this table as base table, do some Java + DB excecise, develop some appian user reporting applciation and thats it.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 10 years ago
If this "SessionListener" class does not need to be deployed into Appian, after developing a SessionListener how can we make it listen to the Appian's session events? do we put it outside appian? or how?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
riteshp
over 10 years ago
no, that has to be there in classpath + web.xml listener entry + jboss node(s) restart.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>