Lasso Soft Inc. > Home

[ Session_Start ]

Method

[Session_Start] starts a new session or loads an exisiting session.

Initializes a session in the current page. If a session has not already been created for the current visitor then a new session is created, otherwise an existing session is loaded.

-Name is the name of the session which is to be started. Multiple named parameters can be used in the same page. The -Name given here must be used in all other [Session_...] methods which are used to manipulate this session.

-Expires is the expiration time for the session in minutes. The session will be automatically deleted after this many minutes of idle time.

The identifier for the named session can be propagated to other pages in the same site using either a -Session parameter added to HTML links or using a cookie. The -UseLink parameter specifies that all links to other pages in the same site should be modified automatically with a -Session command tag. The -UseCookie parameter specifies that a cookie should be created that identifies the session for the current visitor.

-UseAuto will use cookies if they are available or links otherwise.

-UseNone can also be specified if neither method of propagating the session is desired. In this case the session ID must be propagated by the site designer using some other method. A manually propagated session ID can be passed into the [Session_Start] tag in the -ID parameter.

Variables can be added to the session using the [Session_AddVariable] tag. At the end of the current page the value of all the added variables will be stored in the current session. When the session is next recalled the value of the stored variable will be restored.

Once a variable has been added to a session its value will continue to be remembered on each page the session is loaded until a [Session_RemoveVariable] method is called.

  • Syntax
Session_Start(
	'Session Name',
	-Expires=Expires Minutes
)

Session_Start(
	'Session Name',
	-Expires=Expires Minutes,
	-UseLink
)

Session_Start(
	'Session Name',
	-Expires=Expires Minutes,
	-UseCookie,
	-UseLink
)

Session_Start(
	'Session Name',
	-Expires=Expires Minutes,
	-UseNone,
	-id='Session ID'
)
Examples
  • Beginner

To start a server-side session:

Use the [Session_Start] method. The following example creates a session named ShoppingCart and adds several variables to including TotalCost and TotalShipping.

Code

Session_Start(
	'ShoppingCart', 
	-Expires=1440, 
	-UseCookie)

Session_AddVariable('ShoppingCart', 'TotalCost')
Session_AddVariable('ShoppingCart', 'TotalShipping')
Resources
  • Articles

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft