No it doesn't seem to be working:

http://0.0.0.0:8080/
session <Storage {}>
<Storage {}>
69.181.128.98:50734 - - [20/Apr/2008 09:29:49] "HTTP/1.1 GET /" - 200
OK
session <Storage {}>
69.181.128.98:50734 - - [20/Apr/2008 09:29:55] "HTTP/1.1 GET /login" -
200 OK
session <Storage {}>
session set <Storage {'access': 1L, 'user_id': 3L}>
69.181.128.98:50734 - - [20/Apr/2008 09:30:05] "HTTP/1.1 POST /login"
- 302 Found
session <Storage {}>
<Storage {}>
69.181.128.98:50734 - - [20/Apr/2008 09:30:05] "HTTP/1.1 GET /" - 200
OK
session <Storage {}>
69.181.128.98:50735 - - [20/Apr/2008 09:30:24] "HTTP/1.1 GET /login" -
200 OK

I don't like global variables so I'm doing this thing (but it didn't
work with global variables when I tried that yesterday):

myapp = web.application(urls, globals(), web.reloader)
app.Index.session = web.session.Session(myapp,
web.session.DiskStore('sessions'), initializer={'access': 0})

web.config.debug = True
web.webapi.internalerror = web.debugerror
if __name__ == "__main__":
    myapp.run()

and then:

try:
            print "session", self.__class__.session
            request_site =
om.Site(type=type,path=path,input=web.input(),
session=self.__class__.session)
        except AttributeError:
            print "no session"
            request_site =
om.Site(type=type,path=path,input=web.input(),
session=web.storify({'access':0}))

finally I set it here:

if ret[0]["level"]:
                        self.ctx.session.access = ret[0]["level"]
                        self.ctx.session.user_id = ret[0]["id"]
                        print "session set", self.ctx.session
                        if v.get_var("prev"):
                            web.found("/" + v.get_var("prev"))
                        else:
                            web.found("/")
                        return None


I know I'm not showing all of my code here, but you can see it all at:

http://tipling.dyndns.info:4040/websvn/listing.php?repname=om&path=%2Fompy%2F&rev=0&sc=0

On Apr 20, 8:52 am, "Anand Chitipothu" <[EMAIL PROTECTED]> wrote:
> On Sun, Apr 20, 2008 at 1:20 PM, Anand Chitipothu <[EMAIL PROTECTED]> wrote:
> > On Sun, Apr 20, 2008 at 12:35 PM, Bjorn Tipling <[EMAIL PROTECTED]> wrote:
>
> >  >  Sessions don't seem to work for me at all with or without
> >  >  web.reloader. Working with the latest bzr. I see the session cookie in
> >  >  the client, but any session variables I set are lost when I refresh
> >  >  the page. It might be the funny way I'm running my app. I think I'm
> >  >  just going to create my own sessions via Pickle.
>
> It is fixed now. Can you try with the latest trunk?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to