On Fri, 2005-09-23 at 12:44 -0400, Andrew Piskorski wrote:
> Well, I've never seen a clear concise description of what "sessions
> support" means exactly.  

For me it means session id assigned key/value pair data that is
persistent across reboots, shutdowns, etc.  How the session id is
created and related across connections is either by query string or
cookies.

The module I have written is NSV based but caches to disk.  Most
functions appear to be common to all but mine seems to have a few
features that others don't have, eg.  uplevel and capture.

 ns_session new                         # create a new session
 ns_session sessions                    # get a list of all valid sessionid's
 ns_session reset                       # delete all sessions

 ns_session reload sessionid            # reload file-cached session data
 ns_session free sessionid              # releases a session id
 ns_session get sessionid key           # get value of a session var, error if 
no such key
 ns_session value sessionid             # same as 'get' but may include a 
default value if no such key
 ns_session set sessionid key value     # set a session var to a value
 ns_session unset sessionid key         # unset/erase a session var
 ns_session exists sessionid key        # determine if a session var exists
 ns_session append sessionid key value  # append to a session var
 ns_session lappend sessionid key value # append to a session var that is a list
 ns_session incr sessionid key          # incr a session var value by 1
 ns_session names sessionid             # return names of all session vars
 ns_session flush sessionid             # flushes sessionid from memory. will 
reload from disk on next access.
 ns_session save sessionid              # commits a session id to disk
 ns_session eval sessionid key          # eval a session var as code
 ns_session uplevel sessionid ?prefix?  # copies session vars into current mem 
space
 ns_session capture sessionid ?prefix?  # reverse of above

  set mysession [ns_session new]
  ns_session set $mysession fullname "Daniel P. Stasinski"
  ns_session set $mysession location "Phoenix, AZ"
  ns_session save $mysession

  ns_session uplevel $mysession ThisSessionData
  ns_puts ${ThisSessionData.fullname}
  ns_puts ${ThisSessionData.location}

  set ThisSessionData.fullname "Barney Rubble"
  set ThisSessionData.fullname "Bedrock"

  ns_session capture $mysession ThisSessionData
  ns_puts [ns_session get $mysession fullname]
     ## Barney Rubble

-- 
| ---------------------------------------------------------------
| Daniel P. Stasinski         | http://www.disabilities-r-us.com/
| [EMAIL PROTECTED]        | http://www.scriptkitties.com/
| --------------------------- | ---------------------------------
| Jabber: [EMAIL PROTECTED] | Google Talk: mooooooo


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to