473,322 Members | 1,719 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,322 software developers and data experts.

deleting entry from dictionary object when browser is closed.

AnuSumesh
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 1871
DrBunchman
979 Expert 512MB
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
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 Expert 256MB
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
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
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...
4
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
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',...
5
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...
62
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();...
1
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...
9
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,...
1
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.