Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

326
Views
User automatically getting signed out after calling a SOAP API in Laravel 8

I'm working on a Laravel 8 project. Here I need to integrate a SOAP API. Calling of the url is working and callback url is also working. But problem is when I'm calling the API URL, user automatically getting signed out. Badly need to fix this issue. Here is my controller for calling the API. Thanks in advance.

public function dbblpay(Request $req){
    $errmsg = "";
    $userid = '*******';
    $pwd    = '**********';
    
    $dbblurl = "https://ecomtest.dutchbanglabank.com";
    
    try {   
            $txnrefnum = $req->payref;
            $clientIp = $_SERVER['REMOTE_ADDR'];
            $cardType = $req->optcard;
            $totalamount = $req->total; 
            
            $wsdlUrl = $dbblurl.'/ecomws/dbblecomtxn?wsdl';
            $options = array(
            'cache_wsdl' => 0,
            'trace' => 1,
            'stream_context' => stream_context_create(array(
                  'ssl' => array(
                        'verify_peer' => false,
                        'verify_peer_name' => false,
                        'allow_self_signed' => true
                  )
            )));
            $client = new SoapClient($wsdlUrl, $options);
            $cParameters = array(
            'userid' => $userid,
            'pwd' => $pwd,
            'amount' => $totalamount,
            'cardtype' => $cardType,
            'txnrefnum' => $txnrefnum,
            'clientip' => $clientIp
            );
    
            $result = $client->getransid($cParameters);
                
            foreach ($result as $value)
            $TRANSACTION_ID = "N/A"; 
            $part1 = "";
            $part2 = "";
            $errmsg = '';
            
            if (strpos($value,"TRANSACTION_ID") !== false) {
            
                $arr = explode(":",$value);
                $part1 = $arr[0];
                $part2 = $arr[1];
                if ($part1 == "TRANSACTION_ID") {
                    $TRANSACTION_ID = $part2;
                    $_SESSION['trans_id'] = $TRANSACTION_ID;
                    setcookie('trans_id',$TRANSACTION_ID,time()+300,"/");
                    $trans_id_en = urlencode($TRANSACTION_ID);
    
                    header("Location: ".$dbblurl."/ecomm2/ClientHandler?card_type=".$cardType."&trans_id=".$trans_id_en);
                    exit();
    
                } else {
                    $errmsg = $value;
                    return view('dbbl.dbblcheckout', compact('errmsg'));
                } 
           } else {
                $errmsg = $value;
                return view('dbbl.dbblcheckout', compact('errmsg'));
           }
    
    } catch(Exception $e) {
        $errmsg =  "System Problem";
    }
}
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I figured out the problem for myself.

In the config/session.php file I changed the configuration from 'same_site' => "strict", to 'same_site' => "lax", And it worked for me.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!