473,586 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

deleting entry from dictionary object when browser is closed.

AnuSumesh
96 New Member
Hi

I want that if user is logged in on one machine and trying to log in another machine also then he should not be allowed to log in again.
For that--
i am creating Dictionary object on application start event and saving username and cookie value in that after user log in.
and whenever user login , i m checking for existing enteries in dictionary, if dictionary contis entry for user then he is not allowed to login again else allowed to login ad added to dictionary.

The problem i am facing is when user log out then the entry of current user should be deleted from dictionary.

If i am writing code to delete entry in logoff.asp(on click of button) then its working fine.

But if user close the browser or session timeout happens then how can we delete entry.

Can anyone help me in this regard?

Thanks in advance.
Anu
May 19 '08 #1
4 1881
DrBunchman
979 Recognized Expert Contributor
Hi Anu,

In your Global.asa file you can create a sub called Session_OnEnd which will fire after the user ends their session or it times out. Use this to run code at the end of a users session.

Hope this helps,

Dr B
May 20 '08 #2
AnuSumesh
96 New Member
Hi,

Session_OnEnd is not getting called at all.
I have tried this option.
Even then if user closes the browser then what to do?

Thanks,
Anu


Hi Anu,

In your Global.asa file you can create a sub called Session_OnEnd which will fire after the user ends their session or it times out. Use this to run code at the end of a users session.

Hope this helps,

Dr B
May 20 '08 #3
jeffstl
432 Recognized Expert Contributor
Hi,

Session_OnEnd is not getting called at all.
I have tried this option.
Even then if user closes the browser then what to do?

Thanks,
Anu
I would keep trying things in the Session_OnEnd, because that is exactly what its built for. Also when you say its not working, can you determine why ? For example debugging your Session_OnEnd event to find out where its failing to do its job?

The events of the global.asa file have always been somewhat questionable to me as well. You may not get it to work, below is a link discussing this kind of problem.
Problems with Session_OnEnd

If you are desperate you can either
A) Use cookies only, and have them expire off the users machine
B) Use a web service (ActiveX exe) that is constantly running to check for old logins to remove.
May 20 '08 #4
AnuSumesh
96 New Member
Hi,

Thanks for reply.
I think u did not read my question properly.
Clearing session is not a problem.
I am using Dictionary Object and saving username and cookie in that dictionary as key-value pair.
whenever user log off, then his/her entry should be deleted from dictionary.
Its working fine if user follows proper logoff procedure
But the problem is if user directly close the browser or browser crashes for some reason then the entry will not be deleted from dictionary and user will not be allowed to login again .
Is there any solution for this problem?
Regards,
Anu


I would keep trying things in the Session_OnEnd, because that is exactly what its built for. Also when you say its not working, can you determine why ? For example debugging your Session_OnEnd event to find out where its failing to do its job?

The events of the global.asa file have always been somewhat questionable to me as well. You may not get it to work, below is a link discussing this kind of problem.
Problems with Session_OnEnd

If you are desperate you can either
A) Use cookies only, and have them expire off the users machine
B) Use a web service (ActiveX exe) that is constantly running to check for old logins to remove.
May 21 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2083
by: TWiSTeD ViBE | last post by:
Hi, While pouring over some code I've discovered a previous developer heavily uses the "dictionary" object. Whilst I see some of the advantages of using this system It's something I've not used myself so am not sure of the limitations. We are about to widen the scope of the website it's being used on to a WorldWide system - greatly...
4
1460
by: Amir Michail | last post by:
Hi, I think it would be useful to delete a name of a parameter object as the object is passed to a function: dosomestuff(del a) instead of dosomestuff(a)
9
3898
by: kermit | last post by:
I keep seeing that you can use the FileSystemObject in either VB script, or Javascript on an aspx page. I added a refrence to the scrrun.dll I added importing namespaces for 'System.Object', 'Scripting', 'Scripting.FileSystemObject', and a few others However, when I try to create the fso object I keep receiving an error. 'ActiveX...
5
2422
by: John Veldthuis | last post by:
My code works perfectly 100% when adding items to my ArrayList and updating the listbox. Works perfectly when deleting an item in the ArrayList when it is not the last entry but if it is the last entry and you select another index it goes boom!!!. Funny thing is the SelectedIndex Changed routine fires off perfectly and then crash after the...
62
17693
by: ivan.leben | last post by:
How can I really delete a preloaded image from memory/disk cache? Let's say I preload an image by creating an Image object and setting its src attribute to desired URL: var img = new Image(); img.src = ; Then I use the image a few more times by adding it into an Array object:
1
2750
by: arv6004u | last post by:
Hi, I have created Map Data stacture. Each map Entry contains hostname and it's value. I have traversed the map using iterator then i want to delete specific hostname entry and to change the remaining map value for the existing hostnames. My sample code as follows. typedef struct _CAAMT_Credentials {
9
8345
by: potholer | last post by:
I have been asked to create a self deleting exe, it has been a curious task that has proved fruitless I have searched in various places but to no avail I can do it in vb6 using a batch file, but I have been advised it would be better to use C or C++ does anyone know how to do this and the call it from vb6? thanks in advance
1
3180
by: sphinney | last post by:
All, I'm not sure how to adequately explain my problem in two sentences or less, so at the risk of providing TMI, here's the condensed verion. I have developed an Access 2002 database file that contains a form, multiple queries and multiple reports. The purpose of the form is to allow the user to run various queries against my company's...
0
2367
by: Andy B | last post by:
I have the following gridview. There are 2 other textBoxes and a button on the page as well. When somebody puts text into the 2 textBoxes and presses the add button, it puts the values of those textBoxes into the DataTable. The gridView shows what values have already been entered into the DataTable. <asp:GridView ID="DefinitionList"...
0
7915
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...
0
7841
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...
0
8204
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. ...
0
8339
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...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3838
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1184
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.