--- securesite.inc	2009-10-05 03:51:42.551372134 -0400
+++ securesite.inc.orig	2009-10-05 01:28:28.255376000 -0400
@@ -9,7 +9,7 @@
 /**
  * Boot with selected authentication mechanism.
  */
-function _securesite_boot($type) {
+function _securesite_init($type) {
   global $user;
   switch ($type) {
     case SECURESITE_DIGEST:
--- securesite.module	2009-10-05 03:51:42.551372134 -0400
+++ securesite.module.orig	2009-10-05 02:18:58.259364000 -0400
@@ -97,15 +97,9 @@
  */
 function securesite_boot() {
   global $user;
-  // Did the user send credentials that we accept?
-  $type = _securesite_mechanism();
-  if ($type !== FALSE && (isset($_SESSION['securesite_repeat']) ? !$_SESSION['securesite_repeat'] : TRUE)) {
-    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
-    module_load_include('inc', 'securesite');
-    _securesite_boot($type);
-  }
   // If credentials are missing and user is not logged in, request new credentials.
-  elseif (empty($user->uid) && !isset($_SESSION['securesite_guest'])) {
+  $type = _securesite_mechanism();
+  if ($type === FALSE && empty($user->uid) && !isset($_SESSION['securesite_guest'])) {
     unset($_SESSION['securesite_repeat']);
     $types = variable_get('securesite_type', array(SECURESITE_BASIC));
     sort($types, SORT_NUMERIC);
@@ -117,6 +111,26 @@
   }
 }
 
+function securesite_init() {
+  global $user;
+  // Did the user send credentials that we accept?
+  $type = _securesite_mechanism();
+  if ($type !== FALSE && empty($user->uid) && (isset($_SESSION['securesite_repeat']) ? !$_SESSION['securesite_repeat'] : TRUE)) {
+    module_load_include('inc', 'securesite');
+    _securesite_init($type);
+    if(!empty($user->uid)) {
+    	$query = $_GET;
+    	unset($query['q']);
+    	
+    	foreach($query as $key => $value) {
+    		$query[$key] = "$key=$value";
+    	}
+    	
+    	drupal_goto($_GET['q'],implode("&",$query));
+    }
+  }	
+}
+
 /**
  * Return the authentication method used by the client, or FALSE if the client
  * did not send credentials.
