SessionId Property exists or not

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Soha El-Saeed

    SessionId Property exists or not

    Dear All;
    I want to ask about how could I know if a specific sessionid still
    exists or not. If there is a method or anything that can tell me about
    the existence of a specific sessionid .
    Thank You
    Soha El-Saeed
  • Ray at

    #2
    Re: SessionId Property exists or not

    What is your goal here? Just knowing a session number will not do anything
    unless you're tying the session to some other specific piece of information
    you're after, in which case, you can use SEssion_OnEnd to do what you're
    looking to do with that data, I'd imagine.

    --

    Ray at home
    Microsoft ASP MVP


    "Soha El-Saeed" <selsaeed1@gawa b.com> wrote in message
    news:69069de6.0 402080350.27edd 7bb@posting.goo gle.com...[color=blue]
    > Dear All;
    > I want to ask about how could I know if a specific sessionid still
    > exists or not. If there is a method or anything that can tell me about
    > the existence of a specific sessionid .
    > Thank You
    > Soha El-Saeed[/color]


    Comment

    • Soha El-Saeed

      #3
      Re: SessionId Property exists or not

      I want to know that a sessionid exists or not because I have created
      (on the server) for each user a txt file which has the sessionid as
      its name. After the session is ended I have to delete the file , but
      of course I can't use the session_onend event because I can't use
      server.mappath. That's why I need to know if a sessionid exists or not
      so I can delete the corresponding file.
      Thank You for your reply.
      Soha El-Saeed

      Comment

      • Ray at

        #4
        Re: SessionId Property exists or not

        How about storing the path info in a session variable?

        --

        Ray at home
        Microsoft ASP MVP


        "Soha El-Saeed" <selsaeed1@gawa b.com> wrote in message
        news:69069de6.0 402080719.1e354 8da@posting.goo gle.com...[color=blue]
        > I want to know that a sessionid exists or not because I have created
        > (on the server) for each user a txt file which has the sessionid as
        > its name. After the session is ended I have to delete the file , but
        > of course I can't use the session_onend event because I can't use
        > server.mappath. That's why I need to know if a sessionid exists or not
        > so I can delete the corresponding file.
        > Thank You for your reply.
        > Soha El-Saeed[/color]


        Comment

        • Soha El-Saeed

          #5
          Re: SessionId Property exists or not

          I can't use any session variables , properties or methods in the
          session_onend event. So the only way is to know if a sessionid still
          exists or not to delete the file without using the session_onend
          event.
          Thank You
          Soha El-Saeed
          "Ray at <%=sLocation% > [MVP]" <myFirstNameATl ane34dotKOMM> wrote in message news:<OSdyPTp7D HA.1816@TK2MSFT NGP12.phx.gbl>. ..[color=blue]
          > How about storing the path info in a session variable?
          >
          > --
          >
          > Ray at home
          > Microsoft ASP MVP
          >
          >
          > "Soha El-Saeed" <selsaeed1@gawa b.com> wrote in message
          > news:69069de6.0 402080719.1e354 8da@posting.goo gle.com...[color=green]
          > > I want to know that a sessionid exists or not because I have created
          > > (on the server) for each user a txt file which has the sessionid as
          > > its name. After the session is ended I have to delete the file , but
          > > of course I can't use the session_onend event because I can't use
          > > server.mappath. That's why I need to know if a sessionid exists or not
          > > so I can delete the corresponding file.
          > > Thank You for your reply.
          > > Soha El-Saeed[/color][/color]

          Comment

          • Ray at

            #6
            Re: SessionId Property exists or not

            Why not?

            <script language=vbscri pt runat=server>
            sub session_onStart ()
            Session("filePa th") = Server.MapPath( "/") & "\" & Session.Session ID &
            ".txt"
            Set oFSO = CreateObject("S cripting.FileSy stemObject")
            Set oFile = oFSO.CreateText File(Session("f ilePath"), True)
            oFile.Write "hey"
            oFile.Close : Set oFile = Nothing
            Set oFSO = Nothing
            End Sub

            Sub Session_onEnd()
            Set oFSO = CreateObject("S cripting.FileSy stemObject")
            oFSO.DeleteFile Session("filePa th")
            Set oFSO = Nothing
            End Sub
            </script>


            I don't know that I personally would want to do this, but this should work,
            in theory.

            Ray at work



            "Soha El-Saeed" <selsaeed1@gawa b.com> wrote in message
            news:69069de6.0 402082254.6fff3 47a@posting.goo gle.com...[color=blue]
            > I can't use any session variables , properties or methods in the
            > session_onend event. So the only way is to know if a sessionid still
            > exists or not to delete the file without using the session_onend
            > event.
            > Thank You
            > Soha El-Saeed
            > "Ray at <%=sLocation% > [MVP]" <myFirstNameATl ane34dotKOMM> wrote in[/color]
            message news:<OSdyPTp7D HA.1816@TK2MSFT NGP12.phx.gbl>. ..[color=blue][color=green]
            > > How about storing the path info in a session variable?
            > >
            > > --
            > >
            > > Ray at home
            > > Microsoft ASP MVP
            > >
            > >
            > > "Soha El-Saeed" <selsaeed1@gawa b.com> wrote in message
            > > news:69069de6.0 402080719.1e354 8da@posting.goo gle.com...[color=darkred]
            > > > I want to know that a sessionid exists or not because I have created
            > > > (on the server) for each user a txt file which has the sessionid as
            > > > its name. After the session is ended I have to delete the file , but
            > > > of course I can't use the session_onend event because I can't use
            > > > server.mappath. That's why I need to know if a sessionid exists or not
            > > > so I can delete the corresponding file.
            > > > Thank You for your reply.
            > > > Soha El-Saeed[/color][/color][/color]


            Comment

            Working...