El domingo, 10 de marzo de 2013 14:32:59 UTC+1, Niphlod escribió: > > > > 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 these >> strings: >> >> 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..... >
By the way, see a correction (in bold letters) in my previous message (these strings, instead of "this string") Err... I thought that I knew what cookies and session meant, but I am not so sure right now (for me session was always stored in server, using * "session.name"* in web2py... cookies are stored in user browser... and I am not very sure of how to use them, I think they are set using response.cookies and I can get them using request.cookies.value['name']). Anyway as session are stored in server I was thinking "ok, maybe is better to use cookies and not store anything in server". This is my main question. As I said I'm storing about 4 strings in 4 sessions variables. I guess this is just a little storage and with a bit of luck I won't need to care too much, uh? > > >> >> 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! > xD. Well, newbie here. > > >> >> 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. > Ok, this clarifies some questions that I had. -- --- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

