Re: [Cppcms-users] per request data storage?
Brought to you by:
artyom-beilis
|
From: Heiko I. <hi...@93...> - 2013-12-05 15:45:34
|
Hi, hm.. maybe i'm missing something here... i do not want to store full user information in the session cookie, i just want to safe it somewhere for the current request, so i do not re-re-re-re-read it from the database, just because i need it on 5 different locations. i already have a cookie session running, but it only holds the user id and a usertoken. What i would need is some storage, that is neither file/cookie based and does not interfere with the session. Pretty much like some local variables in the actual application instance, but on a point where i do not have this application instance. Is something like this available, or do i have to give the application instance as parameters to every function that might need information limited to the current request? Maybe i'm just thinking too much php here ;) Thanx in advance, Heiko On Thu, Dec 05, 2013 at 07:21:04AM -0800, Artyom Beilis wrote: > http://cppcms.com/wikipp/en/page/cppcms_1x_sessions > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > -------------------------------------------- > On Thu, 12/5/13, Heiko Irrgang <hi...@93...> wrote: > > Subject: [Cppcms-users] per request data storage? > To: cpp...@li... > Date: Thursday, December 5, 2013, 4:50 PM > > Hi there, > > how can i save data per request? > > I store the user id in a browser cookie, then there is a > function > called getCurrentUser() which looks into the cookie, then > gets the user from the database. > > Obviously i do not want to have a database query every time > getCurrentUser() is called within one request, so i want to > store the current user for the current request. > > How can i do this? > > Thanx in advance. |