d
Topic
Posts:
4
February 23, 2013

ohshopify.php failing at setting Session variables This post is outdated

using the ohshopify script to handle authorization, installing the app worked. However after the code was received it seems like  setting the session variables failed. These are necessary in the next step when the location is redirected to index.php. At this next page none of the session variables are available. I tried print_r($_SESSION) on both the installation script page and the index.php page. There was no output. The code is being successfully received and the $_GET variables contain the correct information.

Here are the two lines of code that do not seem to be working:

$_SESSION['token'] = $shopifyClient->getAccessToken($_GET['code']);

$_SESSION['shop'] = $_GET['shop'];

 

i
Replies
Posts:
4
February 23, 2013

Resolved. The application was installed on a server with wordpress installed. Apparently wordpress sends some headers before the script does. The solution was adding the following to the wp_config.php file:

if (!session_id())
session_start();