.htaccess - Godaddy php session not working -
i having issue php sessions returning wrong values when uploaded godaddy (linux) hosting environment. works locally on wampserver (windows 10) absolutely fine. trying use abrahams twitter library, , mentioned works locally.
the code quite simple: 2 files, index.html:
<?php error_reporting( e_all ); session_save_path('/home/aureagle/public_html/sgorilla.com/sessions'); session_start(); echo "<br>" . session_save_path() . "<br>"; require "twitteroauth/autoload.php"; use abraham\twitteroauth\twitteroauth; define('consumer_key', 'xxx'); define('consumer_secret', 'yyy'); define('oauth_callback', 'http://www.sgorilla.com/report.php'); $connection = new twitteroauth(consumer_key, consumer_secret); $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => oauth_callback)); $_session['oauth_token'] = $request_token['oauth_token']; $_session['oauth_token_secret'] = $request_token['oauth_token_secret']; $url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token'])); ?>
...
and url click:
then after user returned twitter, report.html called:
<?php error_reporting( e_all ); session_save_path('/home/aureagle/public_html/sgorilla.com/sessions'); session_start(); var_dump($_session); echo "<br>"; echo "<br>" . session_save_path() . "<br>"; require "twitteroauth/autoload.php"; use abraham\twitteroauth\twitteroauth; define('consumer_key', 'xxxx'); define('consumer_secret', 'yyyy'); $request_token = []; $request_token['oauth_token'] = $_session['oauth_token']; $request_token['oauth_token_secret'] = $_session['oauth_token_secret']; if (isset($_request['oauth_token']) && $request_token['oauth_token'] !== $_request['oauth_token']) { // abort! wrong. echo "<br>abort!"; }
the _session different before, wrong auth values completely. i've spent hours checking paths, changing paths, clearing sessions, deleting sessions - sorts reason session different.
godaddy support can't (just got off phone) , i've spent whole day already.
can please give me suggestions? it's annoying quite simple isn't working.
the session save path /tmp, changing path specified doesn't change (i see sessions appear, weirdly after short delay suspect).
as can see script abort output everytime values don;t match up.
any ideas on try next? i've tried deleting session files doesn't seem make difference.
tia!
Comments
Post a Comment