![]() |
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'])) { |
Why not use $_SESSION?
|
Quote:
|
vBulletin adds things to the session table. Note "inforum", etc. Just insert a field into that table and update it, vBulletin will handle the cleaning up. They are then accessed via $vbulletin->session->vars.
|
Quote:
I just wanted to make sure I do this in the most efficient way possible. Thanks for the tip. |
All times are GMT. The time now is 06:39 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|