I am having problems with session object in Web2py. On localhost the code below works perfectly fine. Session object stores what I need. However, once I run it like so:
$python web2py.py -i <myhomeip>
The session object is always None. I have on session.clear(), but only if email is sent, and code fails way before that. How can this be that the session is not created/exist?
Ajax calls this function:
def generateCart():
session.orderdetail = request.vars;
print "in generateCart() session is", session.orderdetail;
return None;
Then function cart() accesses session:
print "in cart() session.orderdetail", session.orderdetail;
if (len(session.orderdetail.items()) == 0):
print "in cart() order was empty"
redirect(URL('otherfn'));
pass
lOrderDetail = session.orderdetail;
This exact code works when I run as localhost. When I run with -i the print statement above returns None. If I do
print session
I get None.
I don't have session.secure() and don't rely on https for now. I would really appreciate some help on this.