please dont rip this site
Platform SDK: IIS SDK
      [IIS 5.0] [IIS 5.1] [IIS 6.0]

Session.Contents Collection

The Session.Contents collection contains all of the items that have been established for a session without using the <OBJECT> tag. The collection can be used to determine the value of a specific session item, or to iterate through the collection and retrieve a list of all items in the session.

Syntax

Session.Contents( Key)

Parameters

Key
The name of the property to retrieve.

Remarks

You can use an iterating control structure to loop through the keys of the Contents collection, as demonstrated in the following example:

<%@ LANGUAGE="VBSCRIPT" %>

<%

  Dim sessitem

  Dim anArray(2)

  response.write "SessionID: " & Session.SessionID & "<P>"



  anArray(0)="one"

  anArray(1)="second"

  anArray(2)="third"

  Session("anArray")=anArray

  Session("scalar")="1234567890ABCDEFG"



  set objConn=server.createobject("adodb.connection")

  set Session("object")=objConn



  response.write "List of " & Session.Contents.Count & " items in Session

  contents collection:<HR>"

  For Each sessitem in Session.Contents

    If IsObject(Session.Contents(sessitem)) Then

      Response.write(sessitem & " : Session object cannot be displayed." & "<BR>")

    Else

      If IsArray(Session.Contents(sessitem)) Then

         Response.write "Array named " & Session.Content(sessitem) & "<ol>"

         For each objArray in Session.Contents(sessitem)

             Response.write "<li>" & _

             Session.Contents(sessitem)(objArray)& "<BR>"

         Next

             Response.write "</ol>"

      Else

             Response.write(sessitem & " : " & Session.Contents(sessitem) & "<BR>")

       End If

    End If

  Next 

%>

Requirements

Platforms: Windows 2000 with IIS 5.0 installed, Windows XP with IIS 5.1 installed, Windows Server 2003 family with IIS 6.0 installed

Platform SDK Release: February 2003
What did you think of this topic?
Order a Platform SDK CD


file: /Techref/language/asp/OBJ/ref_vbom_sesoccon.htm, 3KB, , updated: 2003/5/15 13:13, local time: 2024/12/24 10:17,
TOP NEW HELP FIND: 
3.147.42.34:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://sxlist.com/Techref/language/asp/OBJ/ref_vbom_sesoccon.htm"> Session.Contents Collection</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .