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

About 'SimpleCache'

Discussion in 'XenForo Development Discussions' started by SJLee, Apr 7, 2015.

  1. SJLee

    SJLee New Member


    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!
  2. Chris D

    Chris D XenForo Developer Staff Member

    The simple cache is global.

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

    SJLee New Member

    Do you mean the following?
    XenForo_Application::getSession()->set($key, $value);
  4. Chris D

    Chris D XenForo Developer Staff Member

  5. SJLee

    SJLee New Member

    Chris, thanks a lot! :)

Share This Page