Skip to content

Do Something About Sessions And Caching #28

@jtickle

Description

@jtickle
  1. Create a SessionManager and a CacheManager.
  2. egrep -r SESSION|GLOBALS *
  3. Go through every single line of output and fix it so it is either using the SessionManager, the CacheManager, or neither.
  4. Create a MiniAdmin link to "Clear Session" and another link to "Clear Cache".

The rule of thumb for session vs cache is like so: if it is something that needs to persist for a SPECIFIC user, put it on the session. No, wait, let me be more clear than that. Put only some kind of reference to an object on the session, like the User ID of who is logged in or some such.

If it's something that CAN persist for ALL users, put it on whatever cache is selected. Put the User ID on the session, but put that user object on the cache.

The good news is that we can use the static Layout and Current_User classes to act as a facade to the new interface pretty easily, so that's nice.

Regarding the user interface: even though "Clear Session" should log me out, it may not be a bad idea to put my user ID back on the session after it is reset. But I think that the User ID is the one magic thing that does not get cleared off of the session - anything else should know how to reload itself if necessary. Maybe I am wrong about that.

┆Issue is synchronized with this Asana task

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions