Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > SessionId Property exists or not

Reply
Thread Tools

SessionId Property exists or not

 
 
Soha El-Saeed
Guest
Posts: n/a
 
      02-08-2004
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
 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      02-08-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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



 
Reply With Quote
 
 
 
 
Soha El-Saeed
Guest
Posts: n/a
 
      02-08-2004
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
 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      02-08-2004
How about storing the path info in a session variable?

--

Ray at home
Microsoft ASP MVP


"Soha El-Saeed" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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



 
Reply With Quote
 
Soha El-Saeed
Guest
Posts: n/a
 
      02-09-2004
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]" <myFirstNameATlane34dotKOMM> wrote in message news:<(E-Mail Removed)>...
> How about storing the path info in a session variable?
>
> --
>
> Ray at home
> Microsoft ASP MVP
>
>
> "Soha El-Saeed" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > 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

 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      02-10-2004
Why not?

<script language=vbscript runat=server>
sub session_onStart()
Session("filePath") = Server.MapPath("/") & "\" & Session.SessionID &
".txt"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.CreateTextFile(Session("filePath"), True)
oFile.Write "hey"
oFile.Close : Set oFile = Nothing
Set oFSO = Nothing
End Sub

Sub Session_onEnd()
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.DeleteFile Session("filePath")
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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]" <myFirstNameATlane34dotKOMM> wrote in

message news:<(E-Mail Removed)>...
> > How about storing the path info in a session variable?
> >
> > --
> >
> > Ray at home
> > Microsoft ASP MVP
> >
> >
> > "Soha El-Saeed" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed) om...
> > > 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check if a directory exists? folder.exists() does not work! Ulf Meinhardt Java 8 08-28-2009 12:26 PM
check property exists in template control philip.poole@gmail.com ASP .Net 0 10-02-2007 10:49 AM
Checking to see if a property exists within an object. Daz Javascript 3 05-04-2007 06:43 PM
finding if file exists or not in apache webdav server and if exists what is the mime type of it.... Totan Java 0 04-17-2006 05:13 AM
generate own unique sessionid instead standard asp.net 120bit sessionid Ronald ASP .Net 6 02-23-2004 08:03 AM



Advertisments