Application Center Usage - Session in ACT

This is Interesting: Free IT Magazines  
Home > Archive > Application Center Usage > February 2004 > Session in ACT





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Session in ACT
Ramsin Savra

2004-02-08, 8:45 am

Hi group,

How can I create a session object in ACT ?
I did :

Dim oSession
Set oSession = CreateObject("ACT.Session")

but ACT script engine complains!

Thanks
Ramsin


Andrés Naranjo[MSFT]

2004-02-08, 8:45 am

I thought the web server creates a session, and the browser, or ACT, simply
gets the session ID so that it can identify itself with the browser when it
wants to continue the session.

I am not sure what you are looking to do here.



Does this answer your question? Thank you for using Microsoft Newsgroups!

Andrés Naranjo [MSFT]
Microsoft DS Communities Team

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only.

Ramsin Savra

2004-02-08, 8:45 am

Hi,

I need to know how I would be able to capture Session information during
a script running under ACT.

Thanks

"Andrés Naranjo[MSFT]" <andresnaOnline@online.microsoft.com.no.spam> wrote
in message news:rVcPxvk1DHA.3564@cpmsftngxa07.phx.gbl...
> I thought the web server creates a session, and the browser, or ACT,

simply
> gets the session ID so that it can identify itself with the browser when

it
> wants to continue the session.
>
> I am not sure what you are looking to do here.
>
>
>
> Does this answer your question? Thank you for using Microsoft Newsgroups!
>
> Andrés Naranjo [MSFT]
> Microsoft DS Communities Team
>
> This posting is provided "AS IS" with no warranties, and confers no

rights.
> Please reply to newsgroups only.
>



Andrés Naranjo[MSFT]

2004-02-08, 8:45 am

Session information, namely the session ID, is sent from the server as part
of the HTTP headers of the response it sends to the client.

You need to parse the response the client gets, to find the Session ID.

When you send a request in ACT to a web server, you do so in a form similar
to:
Set oResponse = oConnection.Send(oRequest)

the oResponse object, is an object which contains the response issued by
the web server, including the Body of the response (HTML
code)(oResponse.Body), the Content length (oResponse.ContentLength), the
HTTP response code (200 OK, 400, 500, etc;) (oResponse.ResultCode), and the
Headers (oResponse.Headers).

The headers are a collection of headers in the response. I recommend you
parse through these to look for your session ID.
To figure out exactly what the headers look like, you could parse the
oResponse.Headers object to see what the server is sending back, and then
altering your code to handle it. A sample function of how to do this, is
in the help documentation, and I am pasting it here:

''''''''''''''''''''''''''''''''''''''''
''''''''''
' Procedure to display the properties of each
' Header object in the Headers collection.
'
Sub ShowHeadersProperties(oResponse)
Dim oHeader, oHeaders, lCount, strInfo

Set oHeaders = oResponse.Headers

strInfo = "-- Headers info --" & vbCrLf
For Each oHeader In oHeaders
strInfo = strInfo & oHeader.Name & ": " & oHeader.Value & vbCrLf
Next

Call Test.Trace(strInfo)
Call Test.Trace("(Total: " & CStr(oHeaders.Count) & _
" header fields)")
End Sub





I am guessing you will eventually want to send the session ID back to the
server, which means you must place it in... yes, you guessed it, in the
header of the follow-up request you send to the server!





Does this answer your question? Thank you for using Microsoft Newsgroups!

Andrés Naranjo [MSFT]
Microsoft DS Communities Team

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com