diff --git a/simplesamlphp_auth.module b/simplesamlphp_auth.module index 69a87fc..aa3ae8b 100644 --- a/simplesamlphp_auth.module +++ b/simplesamlphp_auth.module @@ -286,6 +286,12 @@ function simplesamlphp_auth_init() { $edit = array(); user_login_finalize($edit); + // user_login_finalize() rebuilds the session too late in the current + // process so we have to redirect to the desired page for the session + // to be complete. + $params = drupal_get_query_parameters(); + drupal_goto(current_path(), array('query' => $params)); + } // End if !empty authname. } // End if isset saml_session. }