The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Additional session variable: best way to store and retrieve?
I'm trying to store and reuse a value that should be valid for the entire session, whether a logged-in user or a guest. This value would then be available for use on any page loaded during that session.
Could someone perhaps point me to the most efficient way to do this? I started looking at the vB_Session class which seemed to have some promising methods, but then I realised that these are hard-coded for the existing fields in the session table. Should I simply put something in the datastore? But if I put something in the datastore how will I be sure that it cleans out after the session expires? On re-reading the article about the datastore and taking a look at it, it appears that it isn't really designed for storing data associated with a session. I apologise if this sounds like I'm asking too many questions - but I have been reading through the vB code documentation and various tutorials all day. This is sort of along the lines of what I want: at global_start: Code:
if (!isset($userinfo['foo'])) { $userinfo['foo'] = "Our value to remain for the entire session"; // now we need to save it somehow so when the next page // is loaded it is still here, and this conditional doesn't execute again } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|