CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 Obtain All the Users who have an active session

Print topic Send  topic

Author Message
saamondino

Posts: 33
Posted: 01/10/2011, 11:01 AM

Hi,

I have to obtain All the Users who have an active session and show his Names.

I am using CCS 4.3, Java 1.6, Tomcat 6.0.26 and Oracle XE.

I test this code:

 String[] a = e.getPage().getRequest().getSession().getValueNames();  
 String sUsers = "";  
 int i;  
 int length = a.length;  
 for (i = 0; i < length; i++) {  
	sUsers += Utils.convertToString(  a [ i ]  ) + "<br>";  
 }  
   
 e.getPage().getControl("Users").setValue( sUsers );  
 

The list of Value is :

style
UserID
ccs.Authenticator
CcsLocale
SessionStorage
UserLogin
GroupID


But, I need the list of users who have an active session in the tomcat Server.

Can anybody help me?.

Regards

Sergio.
View profile  Send private message
datadoit
Posted: 01/10/2011, 11:23 AM

What you'll likely need to do is set up a method for recording the
visitor's activity (timestamp), and checking against that. The way I've
accomplished that is to create a field in the user's table for
last_active, then on menu items update that database field when they're
selected.

Then from there you can just query against that field, like:

SELECT * FROM tbl_users WHERE unix_timestamp(now()) -
unix_timestamp(last_active) <= (10 * 60)
saamondino

Posts: 33
Posted: 01/13/2011, 9:17 AM

Hi,

Only registered users enter to the application. In this context, the GUEST users, are not a problem.

I need to know, all the users are logued in to the application, and list of Name Users.
The problem there are the users who close the navigator without using the button of logout.

I was thinking of writing a servlet to count the registered users, but this, not solve my problem, if close navegator, I not detected this.

You that thinks?.

Thanks for answering.

Regards.

Sergio.
View profile  Send private message
matheus

Posts: 386
Posted: 08/10/2011, 2:01 PM

Use HttpSessionListener to logout by timeout.
_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
saamondino

Posts: 33
Posted: 08/11/2011, 4:05 AM

Thank you!!!

But ... it is already late, I do not work any more with CCS. There is no new version of CCS, I am using Groovy on Grails.

Regards.

Sergio.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.