Best practice for storing global data in PHP?
        Posted  
        
            by user281434
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user281434
        
        
        
        Published on 2010-03-08T14:33:11Z
        Indexed on 
            2010/03/08
            14:36 UTC
        
        
        Read the original article
        Hit count: 536
        
Hi
I'm running a web application that allows a user to log in. The user can add/remove content to his/her 'library' which is displayed on a page called "library.php". Instead of querying the database for the contents of the users library everytime they load "library.php", I want to store it globally for PHP when the user logs in, so that the query is only run once. Is there a best practice for doing this? fx. storing their library in an array in a session?
Thanks for your time
© Stack Overflow or respective owner