質問編集履歴

1

試した内容の追加

2017/11/21 05:37

投稿

lovelydai
lovelydai

スコア38

test CHANGED
@@ -1 +1 @@
1
- cakephp3 authで自動ログアウトされた後のRedirect先を定したいです。
1
+ cakephp3 authで自動ログアウトされた後のRedirect先を定したいです。
test CHANGED
@@ -19,3 +19,37 @@
19
19
  何かいい方法がありましたら教えてください。
20
20
 
21
21
  宜しくお願い致します。
22
+
23
+
24
+
25
+ 「追加」
26
+
27
+
28
+
29
+ あと、https://qiita.com/milano/items/9a013ffe875285a04e1c を参考し、以下のように修正してみましたが動きません。
30
+
31
+
32
+
33
+ ```PHP
34
+
35
+ $user = $this->Auth->identify();
36
+
37
+ if ($user)
38
+
39
+ {
40
+
41
+ $this->Auth->setUser($user);
42
+
43
+ $this->Session->delete('Auth.redirect');
44
+
45
+ return $this->redirect($this->Auth->redirectUrl());
46
+
47
+ ```
48
+
49
+
50
+
51
+ 自動的にログアウトされた後、URLに http://localhost:8765/?redirect=%2Ffacility という感じでRedirect先が渡されています。
52
+
53
+ セッション削除も効かないし、ダイレクトにURL入れてもダメです。
54
+
55
+ 何かいい方法ありませんかね。