473,385 Members | 1,855 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

session close in JSP

Hi

I am writing a program in JSP which requires user to log in and as he
logs in database was updated with his status on and till the user does
not sign out no other user with same login and password can enter in
the system. as he signs out database was updated but the problem is if
somehow he forgot to sign out and closed the browser or navigate to
other page or site his information was still on in the database. I
want a solution how to update a database when users forgot to signout
but closed the window or browser.
I am using Apache Tomcat ver 4.1.27 with Jsp and SQLServer7.0

Thanks

Megha
Jul 17 '05 #1
4 19054
megha wrote:
Hi

I am writing a program in JSP which requires user to log in and as he
logs in database was updated with his status on and till the user does
not sign out no other user with same login and password can enter in
the system. as he signs out database was updated but the problem is if
somehow he forgot to sign out and closed the browser or navigate to
other page or site his information was still on in the database. I
want a solution how to update a database when users forgot to signout
but closed the window or browser.
I am using Apache Tomcat ver 4.1.27 with Jsp and SQLServer7.0

Thanks
Hi, I already replied to this in your previous thread. Please do not post
the same question twice under a different heading.
***************************************** You should implement the HttpSessionListener interface. In case a session is invalidated either by a pre-defined time-out or when the user closes his
browser, the sessionDestroyed method is called. Use this method to
clean-up whatever that needs to be done in your database when the user
forgets to do a proper logoff.
Brgds,
Herman Megha


--
Suse Linux Professional 8.1 on Athlon 1.1 Ghz 512 Mb
Anti Spam = remove the "dot" and the "at"
Registered Linux User #264690
Jul 17 '05 #2
took look at the comp.lang.java.database
already one discussion on the same thema there now
actual
"megha" <me***@4cplus.com> wrote in message
news:ee**************************@posting.google.c om...
Hi

I am writing a program in JSP which requires user to log in and as he
logs in database was updated with his status on and till the user does
not sign out no other user with same login and password can enter in
the system. as he signs out database was updated but the problem is if
somehow he forgot to sign out and closed the browser or navigate to
other page or site his information was still on in the database. I
want a solution how to update a database when users forgot to signout
but closed the window or browser.
I am using Apache Tomcat ver 4.1.27 with Jsp and SQLServer7.0

Thanks

Megha

Jul 17 '05 #3
Hi
I tried to implement httpsessionlistener interface but it is not
activating
destroy method once the user closes the browser window though it is
properly running the create method. I am using the following code and
in destroy method it has to display only text but it is not. Please
send some suggestion.

public class SessionCounter implements HttpSessionListener {

private static int activeSessions = 0;
static String url="jdbc:odbc:candico";

/* Session Creation Event */
public void sessionCreated(HttpSessionEvent se) {
activeSessions++;
System.out.println("activeSessions90"+activeSessio ns);
}

/* Session Invalidation Event */
public void sessionDestroyed(HttpSessionEvent se) {

System.out.println("activeSessions");

}

public static int getActiveSessions() {
return activeSessions;
}
}


Herman Timmermans <ti********************@skynet.be> wrote in message news:<3f**********************@reader1.news.skynet .be>...
megha wrote:
Hi

I am writing a program in JSP which requires user to log in and as he
logs in database was updated with his status on and till the user does
not sign out no other user with same login and password can enter in
the system. as he signs out database was updated but the problem is if
somehow he forgot to sign out and closed the browser or navigate to
other page or site his information was still on in the database. I
want a solution how to update a database when users forgot to signout
but closed the window or browser.
I am using Apache Tomcat ver 4.1.27 with Jsp and SQLServer7.0

Thanks


Hi, I already replied to this in your previous thread. Please do not post
the same question twice under a different heading.
*****************************************
You should implement the HttpSessionListener interface. In case a session

is invalidated either by a pre-defined time-out or when the user closes his
browser, the sessionDestroyed method is called. Use this method to
clean-up whatever that needs to be done in your database when the user
forgets to do a proper logoff.
Brgds,
Herman
Megha

Jul 17 '05 #4
you must include <session-timeout> in your web-xml. In other cases the
session never expires.

you could test with value=1 (one minute) to test.

bye
"megha" <me***@4cplus.com> escribió en el mensaje
news:ee**************************@posting.google.c om...
Hi
I tried to implement httpsessionlistener interface but it is not
activating
destroy method once the user closes the browser window though it is
properly running the create method. I am using the following code and
in destroy method it has to display only text but it is not. Please
send some suggestion.

public class SessionCounter implements HttpSessionListener {

private static int activeSessions = 0;
static String url="jdbc:odbc:candico";

/* Session Creation Event */
public void sessionCreated(HttpSessionEvent se) {
activeSessions++;
System.out.println("activeSessions90"+activeSessio ns);
}

/* Session Invalidation Event */
public void sessionDestroyed(HttpSessionEvent se) {

System.out.println("activeSessions");

}

public static int getActiveSessions() {
return activeSessions;
}
}


Herman Timmermans <ti********************@skynet.be> wrote in message

news:<3f**********************@reader1.news.skynet .be>...
megha wrote:
Hi

I am writing a program in JSP which requires user to log in and as he
logs in database was updated with his status on and till the user does
not sign out no other user with same login and password can enter in
the system. as he signs out database was updated but the problem is if
somehow he forgot to sign out and closed the browser or navigate to
other page or site his information was still on in the database. I
want a solution how to update a database when users forgot to signout
but closed the window or browser.
I am using Apache Tomcat ver 4.1.27 with Jsp and SQLServer7.0

Thanks


Hi, I already replied to this in your previous thread. Please do not post the same question twice under a different heading.
*****************************************
You should implement the HttpSessionListener interface. In case a
session is invalidated either by a pre-defined time-out or when the user closes his browser, the sessionDestroyed method is called. Use this method to
clean-up whatever that needs to be done in your database when the user
forgets to do a proper logoff.
Brgds,
Herman
Megha

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Pack Fan | last post by:
I've noticed that session variables will persist on Mac IE even after all browser windows have been closed. One must quit the program to clear the session variables. This presents a security risk...
1
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script :...
3
by: Paul | last post by:
Hello, First I want to refer to the problem "WebRequest : execute a button" of a few days ago. The way I solved it, I loose my session, and as a consequence my session variables. I don't want...
6
by: Gonenc Ercan | last post by:
Hi, I ve ended up debugging a ASP.NET project (with about 380 files on the project .NET Framework 1.0 on IIS 5.0) which has a memory leak... The memory rises too fast. With about 25-30 active...
9
by: charliewest | last post by:
Hello - I have images saved in my SQL SERVER 2000 database. Using ASP.NET (C#) is there any way to temporarily save an image to a session object, and after running some other operations, later...
2
by: Antonio Dias | last post by:
Hi all, I'm hoping someone can help me with this question: I'm building a winforms .net application which is going to use a web service with https. I have a certificate protected in a ...
14
by: aroraamit81 | last post by:
Hi, I am facing a trouble. I have some Session variables in my code and somehow my session variables are getting mixed up with other users. For example User A has access to 10 companies and...
3
by: Steph | last post by:
Hi, I am a programmer and I have a question about a ASP.NET peace of code. I have a program that has a session timeout of 2 minutes configured in Web.config file: <sessionState...
9
by: forje | last post by:
Hi all, How to make a session "exclusive"? When one attempts to open a new session either he's warned and asked to wait or any other openned session is closed. The need is to force only one user...
4
by: rgparkins | last post by:
Hello I am running out of time with a problem I have running PHP 5.04 and Apache 2.0 and really need help :(. I have a page that stores a variable in session but each time I reload that page the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.