473,657 Members | 2,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 19071
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 HttpSessionList ener interface. In case a session is invalidated either by a pre-defined time-out or when the user closes his
browser, the sessionDestroye d 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.c om> wrote in message
news:ee******** *************** ***@posting.goo gle.com...
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 httpsessionlist ener 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 HttpSessionList ener {

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

/* Session Creation Event */
public void sessionCreated( HttpSessionEven t se) {
activeSessions+ +;
System.out.prin tln("activeSess ions90"+activeS essions);
}

/* Session Invalidation Event */
public void sessionDestroye d(HttpSessionEv ent se) {

System.out.prin tln("activeSess ions");

}

public static int getActiveSessio ns() {
return activeSessions;
}
}


Herman Timmermans <ti************ ********@skynet .be> wrote in message news:<3f******* *************** @reader1.news.s kynet.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 HttpSessionList ener interface. In case a session

is invalidated either by a pre-defined time-out or when the user closes his
browser, the sessionDestroye d 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.c om> escribió en el mensaje
news:ee******** *************** ***@posting.goo gle.com...
Hi
I tried to implement httpsessionlist ener 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 HttpSessionList ener {

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

/* Session Creation Event */
public void sessionCreated( HttpSessionEven t se) {
activeSessions+ +;
System.out.prin tln("activeSess ions90"+activeS essions);
}

/* Session Invalidation Event */
public void sessionDestroye d(HttpSessionEv ent se) {

System.out.prin tln("activeSess ions");

}

public static int getActiveSessio ns() {
return activeSessions;
}
}


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

news:<3f******* *************** @reader1.news.s kynet.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 HttpSessionList ener interface. In case a
session is invalidated either by a pre-defined time-out or when the user closes his browser, the sessionDestroye d 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
3635
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 for my session variable based security scheme. Basically, the risk is that a user will login to my site, close the window when done and allow someone else to come up to the machine, go back to my site and be logged into the previous user's...
1
7972
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 : VBScript and Javascript Client : 1. IE browser. 2. VBForm embedded with WebBrowser control (MS Internet
3
6345
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 to keep those variables, as an alternative, as ViewState variables because I don't want to transfer to many hidden fields. This is the code I use :
6
2381
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 sessions (average) the memory rises about 300 MB's in an hour. I've checked the database (SQL Server 2000) and seen that there are lots of sleeping connections. (about 400!!!) I thought somewhere in the code they left the connection open, so decided...
9
9772
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 retrieve the image from the session object, convert it back to an image, and re-save it to the database? Thanks?
2
3603
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 biometric smart-card and the firt time i call the web-service i have to use my fingertip to release the private key to establiss the ssl session. The next requests to the web service do not ask for my fingertip again which is ok, the ssl session is...
14
2367
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 User B has access to 5, now when both of us hits to the server at the same time then their session variables gets mixedup means either User A and USer B will have now 5 companies or both have 10 companies. Now again when User A hits to the server...
3
1552
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 mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
9
2484
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 at the same time. I'm currently using the database but also looking at a php only solution. Thanks in advance. -- Forje
4
2867
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 session seems to be re-created and is an empty array. I have checked the session file and the variable is being stored against the session id, but I dont know why PHP is not picking up the session after I reload.. I have tried the usual suspects...
0
8397
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6167
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.