Hi,
I have a weird issue with twitter oauth, I have to go through clearsessions.php for $_SESSION to be able to pick up the values, otherwise if I dont, the following condition on line 14 in callback.php returns true and I get redirected to clearsessions.php :
if (isset($_REQUEST[‘oauth_token’]) && $_SESSION[‘oauth_token’] !== $_REQUEST[‘oauth_token’])
I tried to var_dump $_SESSION and here is the output (which makes sense according to the condition above : array(1) { [“oauth_status”]=> string(8) “oldtoken” }
I have tried several internet browser, and have tried incognito mode on chrome, but no luck there. I always have to go through clearsessions.php, note that if I comment the line header() and stay on callback.php as I return from twitter.com auth, I cannot go through the entire process if I just go back to redirect.php without going to clearsessions.php first, it would just send me back to callback.php and so on.
I really think that it’s just a local issue as many of my friend don’t experience the same problem, and the script has not been edited, and is hosted on OVH (the biggest french hosting company), here is the url : http://www.la-touline.fr/apit2/, but down teh line any issue I have could be experienced by other people at some point…
I’m really desperate, any suggestion would be appreciated.
Thank you very much.
Bastien
PS : Abraham, if you read this, note that I’m the one who sent you an email two days ago, I thought I got it workin when I saw your reply, but I suppose I was wrong. Sorry for the trouble.
update 1 : Ive found an other person who encounters the same issue with the script
update 2 : Ive done a var_dump($_REQUEST); on connect.php, and here are the outputs :
- before first connection query (the one which fails), $_REQUEST shows NULL
- after going through clearsessions.php :
array(2) { [“PHPSESSID”]=> string(26) “ehnkb8qedqhgib3gh5cfi906q4” [“start”]=> string(10) “R118742758” }
I’m not sure I understand where those variable come from as why do I not get them the first time ? Where am i suppose to pull them out from…I mean how can I define them both, are they meant to have a specific value or is it just a random value, I’m really confused…?
edit 3 : Alright, I’ve commented the line sessions_destroy(); in clearsessions.php, and now if I go through clearsessions.php before goin to connect.php, I get a $_REQUEST variable defined, but i still cannot get a query workin after connecting to twitter, but going through clearsessions.php again (still without sessions_destroy()
makes it work, and I can egt a query workin after connecting to twitter again.
Alright so if I go over the issue again, there are three interesting cases :
- with the script as I d/l it : I need to log twice onto twitter to get a query output
- if I comment the header() goin to clearsessions.php in the file callback.php, I cannot get anything workin at all unless i go through clearsessions.php
- if I comment destroy_session(); in clearsessions.php, I still need to go through it once to be able to get it workin.
This is really confusing :-/