• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

About 'SimpleCache'

SJLee

New member
#1
Hello,

I am trying to use setSimpleCacheData/getSimpleCacheData, but am very confused if the 'SimpleCache' is session-specific or global.

If A-user opens a page that uses the setsimplecache with 'aSIMPLEKEYNAME'-key and B-user opens the same page, are both A and B users using the same 'aSIMPLEKEYNAME'-key? Or, are each users using one's own 'aSIMPLEKEYNAME'-key?

I want to keep some data across pages, but session-specifically. What do you think is best for the case?

Thanks in advance!
 

Chris D

XenForo developer
Staff member
#2
The simple cache is global.

If you want to store session specific information you can save it directly to the session.
 

SJLee

New member
#3
Do you mean the following?
XenForo_Application::getSession()->set($key, $value);
XenForo_Application::getSession()->get($key);