/** * Redirects the page to the original url, prior to OAuth initialization. This removes the extraneous * parameters from the URL, adding latency, but increasing user-friendliness. */ public function redirectToOriginal() { $originalUrl = $this->storage->get($this->storageKey . ":originalUrl"); if ($originalUrl && !empty($originalUrl)) { // The url was retrieve successfully, remove the temporary original url from storage, and redirect $this->storage->delete($this->storageKey . ":originalUrl"); header("Location: {$originalUrl}"); } }