From: David C. <da...@za...> - 2000-10-13 18:54:12
|
[slightly off-topic warning....] Thanks. This does beg a more abstract question of why nobody else has found the need to delete from session. This makes me worried that I'm missing a better technique. As an example, I have a PSP snippet form. The code that handles the form POST expects to see some variables in the current session -- for example, a page to redirect to on a processing error. When this code is finished, I want to "clean up," and remove the session key/value pair. I could pass this parameter as a hidden value in the form, but this seems less efficient, and open to abuse (since it exposes some inner workings to the client). Is there a better way of handling this? Thanks, -- David --On Friday, October 13, 2000 10:35 AM -0400 Chuck Esterbrook <ec...@mi...> wrote: > At 08:39 PM 10/12/00 -0700, David Creemer wrote: >> There doesn't seem to be a clean way to delete state from a Session >> object. I can onviously break encapsulation, and do: >> >> del self.session()._values['key'] > > Wow. I think this is the first time anyone has ever deleted anything from > a session. :-) > > I've been developing actual sites with Webware, but haven't needed this > to date. > > >> but it would be nice if I could just use a method. I propose something >> like: >> >> def delValue( self, name ): >> del self._values['key'] >> >> is this reasonable? or am I missing something obvious? > > Agreed, that it's reasonable. Don't think you're missing anything. > > -Chuck > > _______________________________________________ > Webware-discuss mailing list > Web...@li... > http://lists.sourceforge.net/mailman/listinfo/webware-discuss ------------------------------- David Creemer da...@za... |