CodeIgniter Forums
Query String hook and (any) Open ID implementation. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Query String hook and (any) Open ID implementation. (/showthread.php?tid=36565)



Query String hook and (any) Open ID implementation. - El Forum - 12-06-2010

[eluser]Kindari[/eluser]
Anyone know why in the query string hook, clean_uri modifies $_SERVER['QUERY_STRING']?
Below is my adventure for the day and how I made OpenID work when using this hook.

----
Today I decided to implement OpenID on my server. I began having problems almost immediately, even following all directions in the various tutorials. I tried many OpenID implementations including ones just for PHP and even for CodeIgniter.

After a while I decided to test things on a fresh CI Install, and it worked great. So I started with the most obvious things that could be causing problems, my hooks.

After disabling my hooks in the configuration file, OpenID worked just fine with my existing site. I only have two hooks installed, CI uhoh and query string support. I suspected that Query String support was causing more of a problem then uhoh so I decided to trace where OpenID uses $_GET.

I found that it does not at all, or at least in the implementations I was testing. I found however that it does immediately use $_SERVER['QUERY_STRING']. So I looked at the hook file and found it was modifying the server variable during the 'clean_uri' function. I'm not exactly sure what the point of this cleaning was but commenting out the assignment to $_SERVER['QUERY_STRING'] both times and re-enabling the hook, everything was working again.

OpenID was logging in, $_GET once again existed, etc.