From: Ian H. <har...@gm...> - 2009-02-20 16:57:54
|
Stephen Deasey wrote: > On Sun, Feb 15, 2009 at 6:55 PM, Ian Harding <har...@gm...> wrote: > >> Hello, >> >> I am migrating to Naviserver from AOLServer mostly because of the >> excellent nsdbi module. >> >> My existing code is depended on the nssession module >> http://bas.scheffers.net/aolserver/ . It doesn't compile and run >> unmodified under Naviserver, but before I start hacking on it, is >> there an existing session module or a tcl solution that someone else >> has already written? >> >> > > > I'm not sure that it's worth porting that module. The cache locking is > broken, the file handling looks dodgy, and in general it has some odd > ideas about configuration and string handling. > > If all you need to do is replicate some ns_session Tcl commands so > your existing code works then the easiest way would be to create a > work-alike using the existing naviserver Tcl commands: > > * cookie handling: naviserver has this built in: > http://naviserver.sourceforge.net/n/naviserver/files/ns_cookie.html > > * caching: also now built in: > http://naviserver.sourceforge.net/n/naviserver/files/ns_cache.html > > * persisting the session: just use nsdbi, if you're already using > it. If you really want > to use the file system, use ns_hashpath in nsd/pathname.c to > prevent enormous > directories from bogging down the server. > > * ns_rand: already exposed. > > > It will be more robust than than the C nssession module, and almost > certainly faster too. > > > If you want to create something fancier as a C module, I'd be > interested in helping. > I cobbled together one using the built-in cookie and cache stuff. I'm sure I did it wrong. I'll send a link to the code as soon as I get the changes posted. I am not doing the filesystem persistence. If I even bother with it I'll do it in the database. Thanks! - Ian |