I am now trying to reuse the exact same page in another page however I am calling it using php
. When I call the page this way, the $_SESSION array is empty isempty() = 1.
Is this because I am initiating a new session using file_get_contents and the values I stored in the $_SESSION on login are not available to me within there?
It makes sense that the new call doesn’t have access to the existing session…I have now tried to send the cookies across but I cannot access the page:
I now get: failed to open stream: HTTP request failed! When trying to execute:
$opts = array('http' => array('header'=> 'Cookie: ' . $_SERVER['HTTP_COOKIE']."\\r\ ")); $context = stream_context_create($opts); $contents = file_get_contents($base_url.'admin/send.sms.php?order_id='.order_id, false, $context);
YET, the URL works fine if I call it as: (It just doesn’t let me access session)