Re: Session management module - thoughts

From: Date: Fri, 28 May 1999 19:19:50 +0000
Subject: Re: Session management module - thoughts
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-6200@lists.php.net to get a copy of this message
On Fri, May 28, 1999 at 02:31:10PM -0400, Jim Winstead wrote: > On May 28, Sascha Schumann wrote: > > int session_start(string zone_path [, string CookieName [, string Id]]); > > I'm a little worred about the use of optional parameters here -- > the problem is that to get at some of them, you're forced to deal > with ones you might not want to otherwise. I think we're better > off putting the zone_path and cookie_name ones into seperate little > functions (ie. session_cookie_name and session_save_path -- these > should return the current setting as well as taking an optional > argument to set them). Ok, I agree. About the serialization stuff - is the code in var.c capable of doing the necessary things? > Some other functions to add: > > string session_id([string id]) -- get/set the current session id > > string session_encoded(int id) -- session as one big string > suitable for storing someplace (and we probabaly want this > to be safe for SQL queries and such, so people don't have > to call addslashes() on it) Well, addslashes introduces extra overhead to the whole process which might not be necessary. If someone wants to write his own I/O functions for session data, he should be able to add one addslashes call (or turn on magic_quotes_*). > array session_variables(int id) -- get the session as a big > associative array > > register_session_loader(string function) -- register a function > that takes the same arguments as session_start to implement > retrieving the session data -- this is why session_id, > session_cookie_name and session_save_path need to be able > to return the current value as well as set them) > > register_session_saver(string function) -- obvious, although > a better word than "saver" would be nice. :) writer? Sounds better than saver. > register_session_destructor(string function) -- again, obvious > > session_unset(string variable) -- remove a variable from the > session (this isn't just an issue of not adding it, since it > may have been added on a previous page or whatever) > > Jim > > -- > 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 > > -- Regards, Sascha Schumann Consultant -- 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

« previous php.dev (#6200) next »