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

Session cleaning problem

At a summary page, I am trying to clean up Session.Contents so the user can
go back to the main page and not retain any unnecessary info.
I have entered this into my summary page, but it seems to only eliminate
every other or every third entry. If I refresh the page about 0 times
everything eventually clears out. Anyone know why it would do this?

I don't want to use Session.Abandon because there are a few Session.Contents
I want to retain, like usernams and passwords.

<%
----snip----
For Each objItem in Session.Contents
Session.Contents.Remove objItem
Next
----snip----
%>

Session.Contents are being added like this:

<%
----snip----
Session("uName") = uName 'put info into a session variable
Session("uEmail") = uEmail 'put info into a session variable
Session("uPass") = uPass 'put info into a session variable
Session("uDomain") = uDomain 'put info into a session variable
----snip----
%>

Thanks
--
__o
_-\<,
(_)/(_)____
Jul 19 '05 #1
1 1610
I found my answer.
---------
arrSessionsToKeep = array("uName","uPass","uEmail","uDomain")
strSessionsToDelete = ""
for each objItem in Session.Contents
OkayToDelete = True
for each arrItem in arrSessionsToKeep
if arrItem = objItem Then
OkayToDelete = False
exit for
end if
next
if OkayToDelete then
strSessionsToDelete = strSessionsToDelete & objItem & ","
End If
next
arrSessionsToDelete = Split(strSessionsToDelete, ",")
for each arrItem in arrSessionsToDelete
Session.Contents.remove(CStr(arrItem))
next
---------
"Dan King" <da*******@earthlink.net> wrote in message
news:uQ**************@TK2MSFTNGP14.phx.gbl...
At a summary page, I am trying to clean up Session.Contents so the user can go back to the main page and not retain any unnecessary info.
I have entered this into my summary page, but it seems to only eliminate
every other or every third entry. If I refresh the page about 0 times
everything eventually clears out. Anyone know why it would do this?

I don't want to use Session.Abandon because there are a few Session.Contents I want to retain, like usernams and passwords.

<%
----snip----
For Each objItem in Session.Contents
Session.Contents.Remove objItem
Next
----snip----
%>

Session.Contents are being added like this:

<%
----snip----
Session("uName") = uName 'put info into a session variable
Session("uEmail") = uEmail 'put info into a session variable
Session("uPass") = uPass 'put info into a session variable
Session("uDomain") = uDomain 'put info into a session variable
----snip----
%>

Thanks
--
__o
_-\<,
(_)/(_)____

Jul 19 '05 #2

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

Similar topics

1
by: D | last post by:
In my global.asax file, I have in Session_End(Object sender, EventArgs e) Server.Transfer("logon.aspx"); Because I want to have my user relogon. But it simply does not work. I keep getting the...
31
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily...
13
by: Nagib Abi Fadel | last post by:
Is it possible to create a session variable for each user in Postresql ?? Thx
6
by: Morten Snedker | last post by:
A user enters a password. Via stored procedure i lookup that (unique) password. If it is found I save the userID to a Session("userID") for later use. I use no other saved variables than this one....
3
by: Jim Carlock | last post by:
I have a problem where session cookies get left inside the temporary folder. Is this a common problem or is there perhaps something I've over looked - there a way to make sure the session...
6
by: laredotornado | last post by:
Hi, When a user logs into our site, we create a session variable to denote the session is active and another to denote who is logged in. Once the user closes the browser and re-opens it, the...
4
by: sriram | last post by:
Hello Friends, I am new to this group so big HIIIIIIII to all :) fine i have a serious doubt about session handling in PHP. After 20 min (default time) session getting expired, session values...
2
by: John Gordon | last post by:
I'm developing a web application that needs a semi-persistent way to store information. I've looked at some options such as writing entries to a database table or creating small textfiles, but...
0
by: Now You Know | last post by:
Carpet Cleaners Los Angeles Home Carpet Rug Upholstery Cleaning Phone 1 310 925 1720 OR 1-818-386-1022 Local Call California Wide We offer carpet cleaning services such as; Steam Cleaning, Dry...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
0
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
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.