Unified cookie-handling

unify cookie-handling, and store cookies (possibly) outside of htdocs. Cookie-directory is no longer hard-coded, but defined using a constant, with default directing to PHPs default temp-dir. Also improved cross-plattform-compliance in handling of DIRECTORY_SEPARATOR, and trailing spaces have been removed in the files edited.