LITTLEBLACKDOG.COM Forum Index LITTLEBLACKDOG.COM

 
LWD LWD   FAQ FAQ   Memberlist Memberlist   Usergroups Usergroups   Active Topics Active Topics   Register Register  
  Profile Profile   Log in to check your private messages Log in to check your private messages   Log in Log in  
  Who is Online Who is Online   Image Gallery Image Gallery   Chat Chat   Search Search  
  LWDGear       LBDGear  

View next topic
View previous topic
Post new topic     Reply to topic   LITTLEBLACKDOG.COM Forum Index » Code Warriors
Author Message
evie
Stray Dog


Joined: 13 May 2003
Posts: 1

Post Posted: Tue May 13, 2003 3:57 am   Post subject: global.asa x session.log Reply with quote Back to top  

Mad Hi everyone, ^_^ Mad

Could you guys help me

Well... I was wondering if you people could tell me for which reason the code that I got below is not going through properly...
I have the four following files listed below...
However I cant see where is the problem...
I ve put all(files) in this path...
I bring the site (https://pgex.ipt.br/tj), then I log in and after that I add to it https://pgex.ipt.br/tj/session.asp as showed and as result when I click over session.log it comes in blank to me, instead of to bring the data that come from this line objFile.WriteLine "Session: " & Session.SessionID & " started at " & Now () - in global.asa and so on


Note: I´ve created in blank a file called session.log : | ? ! ? (The session.log cames in blank)

Thanks a lot

Joyce : )


---------------abandon.asp------------------
<%@ Language="VBScript" %>
<%
Session.Abandon
Response.Write("<html><head></head>")
Response.Write("<body onLoad=""self.close();""></body>")
Response.Write("</html>")
%>
---------------global.asa------------------
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

' I do this because you can't use Server.MapPath
' in Session_OnEnd... you'll have to modify this
' to reflect the appropriate path on your server.
Const strLogFilePath = "\\pgex\C\Inetpub\wwwroot\tj\session.log"

Sub Application_OnStart
Application("Start") = Now()
End Sub

Sub Session_OnStart
Session.Timeout = 5
Session("Start") = Now()

Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFilePath, 8, True)
Set objFSO = Nothing
objFile.WriteLine "Session: " & Session.SessionID & " started at " & Now ()
objFile.Close
Set objFile = Nothing
End Sub

Sub Session_OnEnd
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFilePath, 8, True)
Set objFSO = Nothing
objFile.WriteLine "Session: " & Session.SessionID & " ended at " & Now ()
objFile.Close
Set objFile = Nothing
End Sub

Sub Application_OnEnd
End Sub

</SCRIPT>
---------------session.asp------------------
<%@ Language="VBScript" EnableSessionState="True" %>
<html>
<head>
<title>Session Timeout Test</title>
</head>
<body onUnLoad="this.open('abandon.asp', 'CtrlWindow', 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=150,height=150');">

<p>
<strong>Current SessionId: <%= Session.SessionID %></strong>
</p>
<p>
This page just outputs your current session id for
reference. Check the <a href="session.log">session.log</a>
file for session OnStart and OnEnd timestamps.
</p>
<p>
I've set the Session.Timeout to 5 minutes so take note
of your session id and close your browser. Then check
the log file within the next couple minutes. You'll
see no session ended log entry. Wait for the 5 minutes
to pass and check again and it should be there.
</p>

</body>
</html>
---------------session.log------------------

--------------------------------------------------
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
West
Butt Sniffer
Butt Sniffer


Joined: 27 Mar 2003
Posts: 1821
Location: Stealthed

Post Posted: Tue May 13, 2003 8:23 am   Post subject: Reply with quote Back to top  

There is a specific programming board here at LBD.

http://littleblackdog.com/viewforum.php?f=28

You might want to re-post this topic there and delete this one.

Welcome to LBD evie Smile

_________________
View user's profile Send private message Send e-mail
Fido
Big Dog
Big Dog


Joined: 18 Oct 2000
Posts: 4419

Post Posted: Wed May 14, 2003 7:01 pm   Post subject: Reply with quote Back to top  

---> Moved.
View user's profile Send private message Send e-mail Visit poster's website
Lycander
Lead Dog
Lead Dog


Joined: 24 May 2002
Age: 27
Posts: 12389
Location: The Constitution State

Post Posted: Wed May 14, 2003 8:51 pm   Post subject: Reply with quote Back to top  

------------------global.asa----------------------------------
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

' I do this because you can't use Server.MapPath
' in Session_OnEnd... you'll have to modify this
' to reflect the appropriate path on your server.
Const strLogFilePath = "\\pgex\C\Inetpub\wwwroot\tj\session.log"

Sub Application_OnStart
Application("Start") = 0
End Sub

Sub Session_OnStart
Session.Timeout = 5
Application("Start") = Now()
......
......
End Sub


From here on out use Application("Start") rather than Session("Start") in session.asp or where applicable.

For writing to your log file, use a TextStream Object instead, see here:
http://www.w3schools.com/asp/asp_ref_textstream.asp

_________________
Bright, Vibrant, Blue - Lycander's webcomic

Don't fwoosh me bro.
View user's profile Send private message
Lycander
Lead Dog
Lead Dog


Joined: 24 May 2002
Age: 27
Posts: 12389
Location: The Constitution State

Post Posted: Thu May 15, 2003 11:50 am   Post subject: Reply with quote Back to top  

Does this person know their thread got moved?

_________________
Bright, Vibrant, Blue - Lycander's webcomic

Don't fwoosh me bro.
View user's profile Send private message
Display posts from previous:   
Post new topic     Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
phpBB SEO
All times are GMT - 8 Hours

Help us keep advertisements off this site. Donate today!