store data as long as the user is logged on
hi, i need to store some data as long as the user is logged on to zope. how can i achieve this? using the session is not a good idea, because some parts of the code simply call session.clear() (i did not write that part). if everything fails, i can use a singleton where i put a dictionary based on some-kind-of user-id... but i'd like to avoid that if possible (don't want to think about the multi-user-asking-at-the-same-time problems).. is there any place where i could attach my data structure? thanks, gabor
Am Donnerstag, den 21.07.2005, 16:36 +0200 schrieb gabor:
hi,
i need to store some data as long as the user is logged on to zope. how can i achieve this?
using the session is not a good idea, because some parts of the code simply call session.clear() (i did not write that part).
if everything fails, i can use a singleton where i put a dictionary based on some-kind-of user-id... but i'd like to avoid that if possible (don't want to think about the multi-user-asking-at-the-same-time problems)..
is there any place where i could attach my data structure?
Session is still the best thing you can use in this case. Note that HTTP is stateless, you just dont know when a user "logs out". - unless she is so friendly to use a button on your site where you can trigger to delete the session and auth cookie. -- Tino Wildenhain <tino@wildenhain.de>
I'm not sure if I know what I'm talking about, but..... It seams to me that when I was reading up on the session thingy, I read that you can add new Seesion thingy to the Zope tree thereby creating your own private session... Of course I'm Probably wrong.... Jerry On Thursday 21 July 2005 16:58, Tino Wildenhain wrote:
Am Donnerstag, den 21.07.2005, 16:36 +0200 schrieb gabor:
hi,
i need to store some data as long as the user is logged on to zope. how can i achieve this?
using the session is not a good idea, because some parts of the code simply call session.clear() (i did not write that part).
if everything fails, i can use a singleton where i put a dictionary based on some-kind-of user-id... but i'd like to avoid that if possible (don't want to think about the multi-user-asking-at-the-same-time problems)..
is there any place where i could attach my data structure?
Session is still the best thing you can use in this case. Note that HTTP is stateless, you just dont know when a user "logs out". - unless she is so friendly to use a button on your site where you can trigger to delete the session and auth cookie.
Tino Wildenhain wrote:
Am Donnerstag, den 21.07.2005, 16:36 +0200 schrieb gabor:
hi,
i need to store some data as long as the user is logged on to zope. how can i achieve this?
using the session is not a good idea, because some parts of the code simply call session.clear() (i did not write that part).
if everything fails, i can use a singleton where i put a dictionary based on some-kind-of user-id... but i'd like to avoid that if possible (don't want to think about the multi-user-asking-at-the-same-time problems)..
is there any place where i could attach my data structure?
Session is still the best thing you can use in this case. Note that HTTP is stateless, you just dont know when a user "logs out". - unless she is so friendly to use a button on your site where you can trigger to delete the session and auth cookie.
yes, i know that the session is stateless.. it's just that there IS an authentication at the beginning... the standard login/password thing... (i just recently came to the codebase). so ZOPE know when the user logs in and when he logs out. and i'd like to somehow use that information to store my data somewhere. gabor
----- Original Message ----- From: "gabor" <gabor@nekomancer.net> To: "Tino Wildenhain" <tino@wildenhain.de> Cc: <zope@zope.org> Sent: Thursday, July 21, 2005 11:01 AM Subject: Re: [Zope] store data as long as the user is logged on
Tino Wildenhain wrote:
Am Donnerstag, den 21.07.2005, 16:36 +0200 schrieb gabor:
hi,
i need to store some data as long as the user is logged on to zope. how can i achieve this?
using the session is not a good idea, because some parts of the code simply call session.clear() (i did not write that part).
if everything fails, i can use a singleton where i put a dictionary based on some-kind-of user-id... but i'd like to avoid that if possible (don't want to think about the multi-user-asking-at-the-same-time problems)..
is there any place where i could attach my data structure?
you could store the data in a cookie on the user's pc, or create a dictionary and store it in a temp_folder (stored in ram, not persistant). The dictionary would only work if you had a reliable way to identify a returning user (ie. do they log in with an ID that you could use as the dictionary key?). hth Jonathan
participants (4)
-
gabor -
Jerry Westrick -
Jonathan -
Tino Wildenhain