Update: the only access my page has to $_GET['token'] after the redirect from the Google Auth page is within 'echo' statements.
It can't access the variable anywhere else. for instance: strlen($_GET['token']) evaluates to 0 isset($_GET['token']) evaluates false print_r ($_GET) returns nothing HOWEVER... putting strlen($_GET['token']) in an echo statement: echo strlen($_GET['token']) That DOES print the string length to the page. But the code inside: if(strlen($_GET['token']) > 6) doesn't execute. I use the FirePHP extension for firefox and am dumping a bunch of debug info to the console. All of that information confirms that the script can't get the $_GET variable anywhere except in an echo statement. I've never seen anything like it...with quite a bit of PHP under my belt. Interestingly, after being redirected to my URL with the ?token querystring appended. I can hit 'enter' to reload the page, and in that case all of the data is transferred in the request. That's making me suspect something in Google's request headers...but that's not a subject I have a great deal of experience with. Any ideas anyone? It's a serious WTF? John Corry On Feb 14, 10:10 pm, jcorry <[email protected]> wrote: > Hey Folks, > I'm using Cameron's great API and running into a problem. > > The logic of my page is like this: > if authenticated > echo jump for joy > else > clear authentication cookies just to be safe > try > authorizeWithAuthSub($_GET['token']) > catch > the exception > redirect to the google login page > > Simple, right? > > It should work like this: > user comes to the admin page and isn't authenticated. AuthSub throws > an exception since they don't have a good token, they're redirected to > Google log in page. > > This all works. > > On the Google login page, I click 'grant access' and am brought back > to my page (same URL in the $next parameter of redirect function). > This time, I have a token. > > echo $_GET['token'] prints the token to the screen. > > $token = $_GET['token'] > echo $token prints nohing to the screen. > > running authorizeWithAuthSub($_GET['token']) or authorizeWithAuthSub() > (which should use $_GET['token'] throws an exception that tells me I > don't have a token. > > strlen($_GET['token']) evaluates to 0. > > WTF? > > I don't get how I can echo $_GET['token'] and get the value I > expect...but anywhere else I try to use the variable, I get nothing. > > Never seen anything like this before, hope you have and can point me > in the right direction to fix it. > > thanks, > John Corry --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Picasa Web Albums API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Picasa-Data-API?hl=en -~----------~----~----~----~------~----~------~--~---
