Search code examples
phpsessionbackground-process

Running php script in background with session access


I need to call php script from main script that will run in background (i just want to call and proceed without waiting for response) But I need access to user session in called script


Solution

  • My advice is don't use default PHP session because it might be tricky working with background process .... I would recommend session_set_save_handler http://www.php.net/manual/en/function.session-set-save-handler.php for a DB bases session

    There is a good example here http://www.php.net/manual/en/function.session-set-save-handler.php#96305