On Mon, 2002-11-25 at 18:11, Wayne Larsen wrote: > Hey all, > > In building a login system, I authorize the user, and > then put the user object into the session data. That > works great, and I can always query the user's > permission easily, because the user object is easily > accessible. The user object is a middlekit object, > and therein lies the problem. > > When the AppServer attempts to move the session to > file, that user object can not be pickled, because > apparently there is no support for pickling a > middlekit model. I'm left with invalid session data, > and i need to delete the session data and restart the > AppServer to continue. > > I see several ways around this, but I'm not sure what > is the best design. What do others do? > > 1. Store only a handle to the user in the session, and > retrieve the user object from the database when > necessary > 2. Store the relevant information from the user in the > session, instead of just stuffing the whole object > into the session > 3. Enhance MiddleKit to allow this to work > 4. Build a user cache into the user manager (which > appears to be what the design for UserKit is allowing > for, but is not implemented).
Hi Wayne, I've been here before. I implemented custom encoder/decoder routines which dealt with MiddleKit objects by saving the object id in the pickle, and reloaded them from the store when decoding. It's transparent, and works fairly well. I've had some unexplained tracebacks, though, and I have suspicions that something is interacting poorly with this code (I don't yet know how or why). I can send you the code, though, if you want to take a look. cheers, -- Jason D. Hildebrand [EMAIL PROTECTED] -- Jason D. Hildebrand [EMAIL PROTECTED] ------------------------------------------------------- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss