changed unparse_url to unparseURL (PSR-1 standard), fixed sessions on redirections, code improvement