件名の通りです。
どうしたらセッションIDを書き換えずに遷移できますでしょうか?
<?php App::uses('AppController', 'Controller'); App::uses('HttpSocket', 'Network/Http'); class HogeController extends AppController { public $components = [ 'Cookie', 'Session', 'Security' ]; public function beforeFilter() { parent::beforeFilter(); $this->response->disableCache(); $this->Security->validatePost = false; $this->Security->csrfCheck = false; } public function testlogin($id) { ... $HttpSocket = new HttpSocket(); $response = $HttpSocket->post('https://xxxxx.co.jp/hoge/fuga', ['hoge' => 'fuga']); // 同一ドメインのアクションに対してPOST $this->log($response->body, 'debug'); $this->log($response->code, 'debug'); $this->log($this->Session->id(), 'debug'); // このIDと、POSTした先のIDが異なってしまう $this->redirect('https://xxxxx.co.jp/hoge/piyo'); // リダイレクト } }
回答1件
あなたの回答
tips
プレビュー