cokies file
This commit is contained in:
@@ -107,7 +107,7 @@ abstract class BaseController extends Controller
|
||||
|
||||
$result = "Unhandled exception";
|
||||
$base_url = "http://172.16.4.90:3000";
|
||||
// $cookies = tempnam('/tmp','cookie.txt');
|
||||
$cookies = tempnam('/tmp','cookie.txt');
|
||||
|
||||
# 1. Login
|
||||
$url = $base_url . "/api/auth/login";
|
||||
@@ -122,8 +122,8 @@ abstract class BaseController extends Controller
|
||||
//curl_setopt($ch, CURLOPT_HEADER, true); // we want headers
|
||||
//curl_setopt($ch, CURLOPT_NOBODY, true); // we don't need body
|
||||
# Cookie jar
|
||||
// curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
|
||||
// curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
|
||||
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
|
||||
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
|
||||
|
||||
# Send request.
|
||||
$result = curl_exec($ch);
|
||||
@@ -140,8 +140,8 @@ abstract class BaseController extends Controller
|
||||
$url = $base_url . "/api/user/tokens";
|
||||
$ch = curl_init( $url );
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
||||
// curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
|
||||
// curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
|
||||
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
|
||||
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
|
||||
$result = curl_exec($ch);
|
||||
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
Reference in New Issue
Block a user