Cookie creation function was still broken.

The object $dbcore was not passed to the print_js() function so it
didn't know what it was looking for, I also call print_js() before the
$dbcore object is created. So I just used the config variables that are
used to create the $dbcore->URL_PATH variable.