+ok($Auth::deleted_cookie, "deleted_cookie was called");
+is($Auth::failed_login_user, 'test', 'correct user on failed passed information');
+
+sub combined_good { Auth->get_valid_auth({form => {cea_user => "test"}, cookies => {%$cookie_good}}) }
+Auth::reset();
+ok(combined_good(), "Got good auth") || do {
+ my $e = $@;
+ use CGI::Ex::Dump qw(debug);
+ debug $e;
+ die;
+};
+ok(! $Auth::printed, "Printed was not set");
+ok($Auth::set_cookie, "Set_cookie was called");
+ok(! $Auth::deleted_cookie, "deleted_cookie was not called");
+
+sub combined_bad { Auth->get_valid_auth({form => {cea_user => "test2"}, cookies => {%$cookie_good}}) }
+Auth::reset();
+ok(! combined_bad(), "Got bad auth");
+ok($Auth::printed, "Printed was set");
+ok(! $Auth::set_cookie, "Set_cookie was not called");
+ok($Auth::deleted_cookie, "deleted_cookie was called");
+is($Auth::failed_login_user, 'test2', 'correct user on failed passed information');
+
+sub combined_bad2 { Auth->get_valid_auth({form => {cea_user => "test"}, cookies => {%$cookie_bad}}) }
+Auth::reset();
+ok(! combined_bad2(), "Got bad auth");
+ok($Auth::printed, "Printed was set");
+ok(! $Auth::set_cookie, "Set_cookie was not called");
+ok($Auth::deleted_cookie, "deleted_cookie was called");
+is($Auth::failed_login_user, 'test', 'correct user on failed passed information');
+
+sub combined_bad3 { Auth->get_valid_auth({form => {cea_user => "test2/123"}, cookies => {%$cookie_good}}) }
+Auth::reset();
+ok(! combined_bad3(), "Got bad auth");
+ok($Auth::printed, "Printed was set");
+ok(! $Auth::set_cookie, "Set_cookie was not called");
+ok($Auth::deleted_cookie, "deleted_cookie was called");
+is($Auth::failed_login_user, 'test2', 'correct user on failed passed information');
+
+###----------------------------------------------------------------###
+
+Auth::reset();
+Auth->get_valid_auth({form => {%$form_good}, cookies => {}});
+ok($Auth::set_cookie, "Set_cookie called");
+ok($Auth::cookie->{'expires'}, "Cookie had expires");
+
+Auth::reset();
+Auth->get_valid_auth({form => {%$form_good}, cookies => {}, use_session_cookie => 0});
+ok($Auth::set_cookie, "Set_cookie called");
+ok($Auth::cookie->{'expires'}, "Cookie had expires");
+
+Auth::reset();
+Auth->get_valid_auth({form => {%$form_good}, cookies => {}, use_session_cookie => 1});
+ok($Auth::set_cookie, "Set_cookie called");
+ok(! $Auth::cookie->{'expires'}, "Session cookie");
+
+Auth::reset();
+Auth->get_valid_auth({form => {%$form_good}, cookies => {}, use_plaintext => 1});
+ok($Auth::set_cookie, "Set_cookie called");
+ok(! $Auth::cookie->{'expires'}, "Session cookie");
+
+Auth::reset();
+Auth->get_valid_auth({form => {%$form_good}, cookies => {}, use_plaintext => 1, use_session_cookie => 0});
+ok($Auth::set_cookie, "Set_cookie called");
+ok($Auth::cookie->{'expires'}, "Cookie had expires");
+
+Auth::reset();
+Auth->get_valid_auth({form => {%$form_good}, cookies => {}, use_plaintext => 1, use_session_cookie => 1});
+ok($Auth::set_cookie, "Set_cookie called");
+ok(! $Auth::cookie->{'expires'}, "Session cookie");
+