質問編集履歴

2

Application.phpの中身を記載

2018/10/04 08:33

投稿

Discord
Discord

スコア51

test CHANGED
File without changes
test CHANGED
@@ -47,3 +47,59 @@
47
47
  原因がわからず、困っております。
48
48
 
49
49
  ご教示のほど、よろしくお願いいたします。
50
+
51
+
52
+
53
+ 以下、追記です。
54
+
55
+ /src/Application.php
56
+
57
+ ```PHP
58
+
59
+ public function middleware($middlewareQueue)
60
+
61
+ {
62
+
63
+ $middlewareQueue
64
+
65
+ // Catch any exceptions in the lower layers,
66
+
67
+ // and make an error page/response
68
+
69
+ ->add(ErrorHandlerMiddleware::class)
70
+
71
+
72
+
73
+ // Handle plugin/theme assets like CakePHP normally does.
74
+
75
+ ->add(AssetMiddleware::class)
76
+
77
+
78
+
79
+ // Add routing middleware.
80
+
81
+ // Routes collection cache enabled by default, to disable route caching
82
+
83
+ // pass null as cacheConfig, example: `new RoutingMiddleware($this)`
84
+
85
+ // you might want to disable this cache in case your routing is extremely simple
86
+
87
+ ->add(new RoutingMiddleware($this, '_cake_routes_'))
88
+
89
+
90
+
91
+ // Add csrf middleware.
92
+
93
+ ->add(new CsrfProtectionMiddleware([
94
+
95
+ 'httpOnly' => false
96
+
97
+ ]));
98
+
99
+
100
+
101
+ return $middlewareQueue;
102
+
103
+ }
104
+
105
+ ```

1

エラーログについてもコード機能を使い修正

2018/10/04 08:33

投稿

Discord
Discord

スコア51

test CHANGED
File without changes
test CHANGED
@@ -28,6 +28,8 @@
28
28
 
29
29
  エラーログ
30
30
 
31
+ ```エラーログ
32
+
31
33
  Error: [Cake\Http\Exception\InvalidCsrfTokenException] CSRF token mismatch.
32
34
 
33
35
  ..
@@ -36,6 +38,10 @@
36
38
 
37
39
  /hoge/vendor/cakephp/cakephp/src/Controller/Component/CsrfComponent.php(103): Cake\Controller\Component\CsrfComponent->_validateToken(Object(Cake\Http\ServerRequest))
38
40
 
41
+ ```
42
+
43
+
44
+
39
45
 
40
46
 
41
47
  原因がわからず、困っております。