ASP with Python question

Mark Hammond MHammond at skippinet.com.au
Sat Sep 11 23:10:27 EDT 1999


Glen Malley wrote in message <37d87ed7 at news.interq.or.jp>...
>
>Hi, I've got a question regarding ActiveX Scripting
>with Python. I'm having no trouble using the Request
>object or the Response object, but for some reason
>I cannot figure out how to properly use the Session
>object.

Ive had a look at this.  Unfortunately the only IIS server I have handy is
IIS5 that comes with Windows 2000.

I can make session objects work OK by using an undocumented method:
-- some asp file.
<%
Session.SetValue('Key', 4)
%>

My custom session variable is <%= Session("Key") %>
-- end of asp file

Works for me.  Note that "SetValue" is needed to set a value, and
"Session(Key")" is a short-cut to "Session.Value("Key")".  Note that both of
these are methods - hence you need to pass the value as an arg.

There are special hacks in the COM package to recognize "Value", and allow
it to be used using call syntax (ie, "Session("Key")").  However, as Python
does not support assignment to a function call, it is not possible to make
the syntax "Session("Key") = value" work - so you are stuck with "SetValue"

I would appreciate it is someone can tell me if this also works with IIS4
under NT4.

Mark.







More information about the Python-list mailing list