<%@ LANGUAGE = PerlScript%> Active Server Pages - Perl Version
ActiveState PerlScript


Active Server Session Object


This examples uses the ASP Session object. It retrieves a session variable, increments its value, and saves it each time the webpage is reloaded.

<% # get the value associated with 'MyVar' # increment the value then store it back $var = $Session->{'MyVar'}; $var++; $Session->{'MyVar'} = $var; # let the user know what the value of the variable is $Response->write("The value of the session variable MyVar is $var after being incremented"); %>

Click here to see another page access the session variable MyVar.
<% $url = $Request->ServerVariables('PATH_INFO')->item; $_ = $Request->ServerVariables('PATH_TRANSLATED')->item; s/[\/\\](\w*\.asp\Z)//m; $params = 'filename='."$1".'&URL='."$url"; $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg; %> Return

view the source