Re: Session management module: how ASP does it
| From: | Zeev Suraski | Date: | Sat, 29 May 1999 10:26:14 +0000 |
| Subject: | Re: Session management module: how ASP does it | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-6234@lists.php.net to get a copy of this message | ||
On Fri, 28 May 1999, Jim Zajkowski wrote:
> On Sat, 29 May 1999, Zeev Suraski wrote:
>
> } ASP's session API, as far as I know, is equivalent to this:
> }
> } session_start();
> } session_variable($var);
> } session_end();
>
> Having used ASP for too many projects, I'll say that it's even easier than
> this.
>
> In ASP, you just assign 'session("keyname") = value', so, you could:
>
> <% Session("firstname") = "Jim" %>
>
> and then get it with <%= Session("firstname") %>
Well, we can obviously make session_start() be implicit.
> ASP also allows for application-wide variables. Those work the same way,
> except it's Application() rather than Session(). App variables also have
> .Lock and .Unlock methods for mutex-like critical sections. Sesssion
> variables I believe are always synchronized. Sessions can be force-closed
> too, you just call Session.Close().
We could probably add these in the future, but they seem less important
for now.
> ASP allows apps to write handlers for when the App starts (first hit), App
> shuts down (IIS stopped), Session init, Session close, and Page open and
> Page close. They all must be in the global.asa file, based on some
> heirarchical system of directories that I don't really care about. You
> simply write a function Session_OnClose or Session_OnOpen, etc...
With Zend we can easily support those - running PHP code out of context is
a breeze with Zend; As long as we know where to look for that
session-init and session-shutdown code (the only two functions that really
seem useful from your list) - perhaps in a .session_startup.php and
.session_shutdown.php, overridable, this shouldn't be a problem.
> Session on-close trapping is *key* for sites like Amazon and
> drugstore.com, which have one-click ordering where the order is sent when
> the session goes out of state. ASP does it out of the box.
> drugstore.com uses ASP, incidentally.
>
> You may not want that level of easy-ness, since it seems clunky to
> implement. The Java Servlet API works where you instantiate a Session
> class and then call getVariable and setVariable passing a key and a
> variable (or passing a key and getting a variable).
Except for the application object which is cool but not all that necessary
at this stage, the approach seems good.
Ok, at this point, I guess we should start finding people that want to
actively work on that project. Any volunteers?
Zeev
--
-----------------------------------------------------
Zeev Suraski <zeev@zend.com>
For a PGP public key, finger bourbon@netvision.net.il
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net