Also note that you must start your session using session_start() before use of $_SESSION becomes available.
To implement database storage, or any other storage method, you will need to use session_set_save_handler() to create a set of user-level storage functions.