2

Session count

asked 2014-02-12 18:46:23 +0800

interactlb gravatar image interactlb flag of Brazil
25 3
http://www.interact.com.b...

Can I get the total number of active sessions on my web application using ZK API? (using apache-tomcat)

delete flag offensive retag edit

5 Answers

Sort by ยป oldest newest most voted
2

answered 2014-02-12 19:13:07 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...
Sessions.getCount();

see here for the docs

Greetz chill.

link publish delete flag offensive edit
0

answered 2014-02-13 10:36:13 +0800

interactlb gravatar image interactlb flag of Brazil
25 3
http://www.interact.com.b...

Exactly what I need. Thanks for the answer.

link publish delete flag offensive edit

Comments

Your welcome.

chillworld ( 2014-02-13 10:37:08 +0800 )edit
0

answered 2014-02-13 11:06:06 +0800

interactlb gravatar image interactlb flag of Brazil
25 3
http://www.interact.com.b...

Now I have another question: using Sessions.getCurrent().invalidate(), the count number doesn't change after the client makes logout The getCount still returns the total number of clients who where connected on my app.

link publish delete flag offensive edit
0

answered 2014-02-13 11:18:23 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

updated 2014-02-14 11:02:14 +0800

In you web.xml do you have the following :

<listener>        
    <description>ZK listener for cleanup when a session is destroyed</description>
    <listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
</listener>

and if you use spring security its Spring who handle's the sessions so you can do this with code :

HttpSession s = (HttpSession)
Sessions.getCurrent().getNativeSession();
s.invalidate();
Sessions.getCurrent().invalidate();

or check if your spring security config is correct.

link publish delete flag offensive edit
0

answered 2014-02-13 12:04:29 +0800

interactlb gravatar image interactlb flag of Brazil
25 3
http://www.interact.com.b...

it's already configured. Another idea?

link publish delete flag offensive edit

Comments

do you use spring security?

chillworld ( 2014-02-13 12:09:48 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-02-12 18:46:23 +0800

Seen: 34 times

Last updated: Feb 14 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More