ignore PHPStorm's config directory.
use given $session if non-null is given;
can pass empty array to use as session.