jasp.buildin
Class Session

java.lang.Object
  |
  +--jasp.buildin.Session

public class Session
extends java.lang.Object

You can use the Session object to store information needed for a particular user-session. Variables stored in the Session object are not discarded when the user jumps between pages in the application; instead, these variables persist for the entire user-session. The Web server automatically creates a Session object when a Web page from the application is requested by a user who does not already have a session. The server destroys the Session object when the session expires or is abandoned. One common use for the Session object is to store user preferences. For example, if a user indicates that they prefer not to view graphics, you could store that information in the Session object. For more information on using the Session object, see Managing Sessions in the ASP Applications section.

Note: Session state is only maintained for browsers that support cookies.


Constructor Summary
Session()
           
 
Method Summary
static void Abandon()
          Abandon This method destroys a Session object and releases its resources.
static IVariantDictionary Contents()
          Contains the items that you have added to the session with script commands.
static variant Contents(java.lang.String key)
          Gets an item from the Contents collection.
static int getCodePage()
          Determines the codepage that will be used to display dynamic content.
static java.lang.String getEncode()
          Returns the EncodeCharSet
static variant getItem(java.lang.String key)
          Adds an item to the Contents collection
static long getLCID()
          Determines the location identifier that will be used to display dynamic content.
static java.lang.String getSessionID()
          Gets the sessionid
static int getTimeout()
          Specifies the timeout period assigned to the Session object for this Application, in minutes.
static boolean isAbandon()
          Gets true if the Abandon method is called.
static boolean isTimeout()
          Return true if the Session was timeout.
static jasp.buildin.ASPSession session()
          Returns a Session object instance
static void setCodePage(int codepage)
           
static void setContents(java.lang.String key, variant obj)
          Sets an item to Contents collection.
static void setEncode(java.lang.String str)
          Sets the EncodeCharset.
static void setItem(java.lang.String key, boolean value)
          Adds an item to the Contents collection
static void setItem(java.lang.String key, double value)
          Adds an item to the Contents collection
static void setItem(java.lang.String key, int value)
          Adds an item to the Contents collection
static void setItem(java.lang.String key, java.lang.Object value)
          Adds an item to the Contents collection
static void setItem(java.lang.String key, java.lang.String value)
          Adds an item to the Contents collection
static void setLCID(int lcid)
          Sets the lcid
static void setObject(java.lang.String key, java.lang.Object obj)
          Adds an item to the Contents collection.
Note: The value of the item is an object, for example:

set Session("test") = Server.CreateObject("ADODB.REcordset")
static void setTimeout(int timeout)
          The Timeout property specifies the timeout period assigned to the Session object for this application, in minutes.
static IVariantDictionary StaticObjects()
          Contains the objects created with the <OBJECT> tag and given session scope.
static variant StaticObjects(java.lang.String key)
          Gets Gets an item from the StaticObjects collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session()
Method Detail

session

public static jasp.buildin.ASPSession session()
Returns a Session object instance

Contents

public static IVariantDictionary Contents()
Contains the items that you have added to the session with script commands.

StaticObjects

public static IVariantDictionary StaticObjects()
Contains the objects created with the <OBJECT> tag and given session scope.

StaticObjects

public static variant StaticObjects(java.lang.String key)
Gets Gets an item from the StaticObjects collection.
Parameters:
key - the name of the member
Returns:
the value of the member.

Contents

public static variant Contents(java.lang.String key)
Gets an item from the Contents collection.
Parameters:
key - the name of the item
Returns:
the value of the item.

setContents

public static void setContents(java.lang.String key,
                               variant obj)
Sets an item to Contents collection.
Parameters:
key - the name of the item
the - value of the item.

Abandon

public static void Abandon()
                    throws java.lang.Exception
Abandon This method destroys a Session object and releases its resources.

isAbandon

public static boolean isAbandon()
Gets true if the Abandon method is called.

isTimeout

public static boolean isTimeout()
Return true if the Session was timeout.

getItem

public static variant getItem(java.lang.String key)
Adds an item to the Contents collection
Parameters:
key - the name of the item.
Returns:
the value of the item.

setItem

public static void setItem(java.lang.String key,
                           java.lang.Object value)
                    throws java.lang.Exception
Adds an item to the Contents collection

setItem

public static void setItem(java.lang.String key,
                           int value)
Adds an item to the Contents collection

setItem

public static void setItem(java.lang.String key,
                           double value)
Adds an item to the Contents collection

setItem

public static void setItem(java.lang.String key,
                           boolean value)
Adds an item to the Contents collection

setItem

public static void setItem(java.lang.String key,
                           java.lang.String value)
Adds an item to the Contents collection

setObject

public static void setObject(java.lang.String key,
                             java.lang.Object obj)
                      throws java.lang.Exception
Adds an item to the Contents collection.
Note: The value of the item is an object, for example:

set Session("test") = Server.CreateObject("ADODB.REcordset")

getSessionID

public static java.lang.String getSessionID()
Gets the sessionid
Returns:
the sessionid

setEncode

public static void setEncode(java.lang.String str)
Sets the EncodeCharset.

getEncode

public static java.lang.String getEncode()
Returns the EncodeCharSet
Returns:
the EncodeCharSet

getTimeout

public static int getTimeout()
Specifies the timeout period assigned to the Session object for this Application, in minutes.
Returns:
the timeout.

setTimeout

public static void setTimeout(int timeout)
The Timeout property specifies the timeout period assigned to the Session object for this application, in minutes. If the user does not refresh or request a page within the timeout period, the session ends.
Parameters:
timeout - the new timeout value.

getCodePage

public static int getCodePage()
Determines the codepage that will be used to display dynamic content.

setCodePage

public static void setCodePage(int codepage)

getLCID

public static long getLCID()
Determines the location identifier that will be used to display dynamic content.

setLCID

public static void setLCID(int lcid)
Sets the lcid
Parameters:
lcid - the new lcid