will
|
| Posted: 09/21/2002, 6:58 AM |
|
Hi..
could somebody give me explanation about session and parameter in cc
|
|
|
 |
Larry Boeldt
|
| Posted: 09/21/2002, 11:38 AM |
|
Session:
These are session variables. A session variable is one of the five core ASP data objects: Session, Server, Application, Request, Response. The session object is specifically designed to allow storage of information during a series of interactions over time on a web server. A session is simply a term that describes a minimum span of time that you will be "kept alive" on the web server.
Developers use the session object to store information about a user during that interaction. For example if someone logs into the site, code charge stores their UserID in the session. Now if the person comes back to the site before the session's expiration period their UserID will be available to the web server, thus preventing them for having to login again. Sessions expeiration periods can be et with session.expires=mm where mm=minutes, 20 is default.
How it works
===============
IIS keeps track of sessions by storing a cookie on the user's browser. The cookie is named $ASPSESSIONID$ and contains a GUID that is used to retrieve the session from the web server.
IT's important to note this becuase that means for ASP sessions are dependant on the physical hadware that fulfilled and managed on a server by server basis. If you are loadbalancing or clustering your servers, then session by defalut will not be very effective because each request from a given visitor will only have access to session data on that server. If the load balancer sends the next request to a different server, it's as if the last request never existed.
Parameter:
Parameters are retireved from the request object through request.form("VarName") and request.querystring("varname"). Code charge uses forms to send your changes back to the web server for processing. The querystring is the ?s_LastName=McDonald&FirstName=Ronald you see on web pages at times. Code Charge utilizes the query string for search and filtering parameters and to keep track of transfer parameters (ones that are pushed to the next page requested).
So if you want to keep track of something over the site and are not worried about scaling your web application, use the session (there are also tools that can easily store the session variable to a file system (for "permanent state" where a user's settings are reloaded at each visit), or SQLdatabase thus expanding the state of session scope to any web serer that can access your SQL server). The session is especially useful if you wish to load certain settings at login then use them throughout the site for calculations, processing, filtering, or whatever.
Hope this helps.
|
|
|
 |
MindbendR
|
| Posted: 09/23/2002, 7:02 AM |
|
the previous article by: Larry Boeldt is very ituitive in fact. Good job Larry Boeldt.
|
|
|
 |
|