Well I need more than just cookies. I can't serialize the app inbetween each call. I need a working process, which has active data structures (database tables, dictionaires, etc).
Is there anyway for an app to talk out through web2py to a client? I had (incorrectly) understood that sessions stick around and remain. Even if a session object is cookized in between calls doesn't the docs say that the session stuff remains? The manual says: === 4.8 session ------------------ is another instance of the Storage class. Whatever is stored into session for example: session.myvariable="hello" can be retrieved at a later time: a=session.myvariable as long as the code is executed within the same session by the same user (provided the user has not deleted session cookies and the session did not expire). Because session is a Storage object, trying to access an attribute/key that has not been set does not raise an exception, it returns None instead. === Thus I can store myvariable into session and retrieve it at a later time. What the manual _should_ say, if I understand you now, is that the global variable "session" is pickled between each call into a cookie and unserialized with each subsequent call. If your protocol, eg xmlrpc does not use cookies then you can forget about sessions being used to store info to be retrieved at a later time. Argh! This is upsetting. I was thinking that session (and some pythonic process) remained running in between calls. Argh. Thx for the link, I'll check it out. (fingers crossed) === On Aug 11, 4:22 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > This is not a problem with the server but with the client. > You may try the cookie aware xmlrpc client proposed here: > > http://code.activestate.com/recipes/501148/ > > Or you need to pass an extra key to the function calls and is that to > retrieve a session. > > Massimo > > On Aug 11, 6:09 pm, rb <rbspg...@gmail.com> wrote: > > > Further, I added a : > > > session.hello = "hello, world" > > > in order to see if it just didn't want to hold onto MY data. No dice. > > session.hello is gone on the next call as well. > > > --- > > > On Aug 11, 3:02 pm, rb <rbspg...@gmail.com> wrote: > > > > In my think-client xmlrpc protocol to web2py svr code I am trying to > > > maintain data in the session global variable but it doesn't seem to > > > hold it. For example I first start by creating a document-form (tree > > > of datatables), cached in a data structure, as an attribute of > > > session. Here's the code: > > > > from gluon.tools import Service > > > > service = Service(globals()) > > > > def call(): > > > return service() > > > > @service.xmlrpc > > > def xrBeginDocFrm( frmName): > > > ''' create table records and push xrInitRecord down to all tables. > > > ''' > > > if session.frmz == None: > > > session.frmz = {} > > > if not session.frmz.has_key("frmName"): > > > session.frmz[frmName] = rna.DocFrm(db, frmName) > > > > Then later I call the svr to get the table column definitions: > > > > @service.xmlrpc > > > def xrGetColDefs(frmName, tblInstName): > > > tblInst = session.frmz[frmName].GetTblInst(tblInstName) > > > return tblInst.GetColDefs() > > > > but I find that session does not have a frmz attribute. I can walk the > > > debuger through the svr code so I can see that the functions are > > > getting called, but when I inspect session it contains nothing. > > > > I thought sessions stick around forever? I thought that session was > > > the place to keep my own attributes that will live on (between xmlrpc > > > calls). > > > > Heeeeelp! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---