On Sunday, March 10, 2013 2:20:02 PM UTC+1, Jaime Sempere wrote: > > Thanks for your answer. > > I am not storing too much, currenty I am storing for every user this > string: > > facebook_id > another string for the category of the forum where the user is right now > the thread page were the user is > the page of thread list > > This is for every user. I've been trying to use cookies instead of > sessions, but I have not been able to do it right. I do a lot of ajax calls > and I think I am having issues with cookies and ajax (cookies set at wrong > time and not updated at the right time). Sessions is very easy to manage.. >
perfect. I assume you mean cookies set by you vs sessions stored in cookies..... > > I see you talk about 20 instances of web2py. My app is for facebook and I > would like to support more than 20 users at the same times... so am I in > problems? > 20 instances means 20 different servers running web2py! > > Another approach that I've tried is to use global variables (I only need > to store my variables as long as the page is not reloaded), but in ajax > calls it seems to reload the default value. I mean: > > var_global = 1 > def index(): > ..... > > *def increment_global*(): > global var_global > var_global = var_global + 1 > return var_global > > If I call *def_increment_global* using ajax from javascript, var_global > always returns 2. > > Any advice? > there's no global variable unless you cache it. Every request all the models and the controller get executed in a fresh environment. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.