Session cleaning problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan King

    Session cleaning problem

    At a summary page, I am trying to clean up Session.Content s 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.Content s
    I want to retain, like usernams and passwords.

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

    Session.Content s 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("uDomai n") = uDomain 'put info into a session variable
    ----snip----
    %>

    Thanks


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


  • Dan King

    #2
    Re: Session cleaning problem

    I found my answer.
    ---------
    arrSessionsToKe ep = array("uName"," uPass","uEmail" ,"uDomain")
    strSessionsToDe lete = ""
    for each objItem in Session.Content s
    OkayToDelete = True
    for each arrItem in arrSessionsToKe ep
    if arrItem = objItem Then
    OkayToDelete = False
    exit for
    end if
    next
    if OkayToDelete then
    strSessionsToDe lete = strSessionsToDe lete & objItem & ","
    End If
    next
    arrSessionsToDe lete = Split(strSessio nsToDelete, ",")
    for each arrItem in arrSessionsToDe lete
    Session.Content s.remove(CStr(a rrItem))
    next
    ---------
    "Dan King" <danking65@eart hlink.net> wrote in message
    news:uQBwo0YrEH A.4008@TK2MSFTN GP14.phx.gbl...[color=blue]
    > At a summary page, I am trying to clean up Session.Content s so the user[/color]
    can[color=blue]
    > 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[/color]
    Session.Content s[color=blue]
    > I want to retain, like usernams and passwords.
    >
    > <%
    > ----snip----
    > For Each objItem in Session.Content s
    > Session.Content s.Remove objItem
    > Next
    > ----snip----
    > %>
    >
    > Session.Content s 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("uDomai n") = uDomain 'put info into a session variable
    > ----snip----
    > %>
    >
    > Thanks
    >
    >
    > --
    > __o
    > _-\<,
    > (_)/(_)____
    >
    >[/color]


    Comment

    Working...