File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -241,14 +241,16 @@ public static function mainServerCreate(EventRegister $register)
241
241
$ sessionId = $ param ;
242
242
}
243
243
// 从Cookie中获取sessionId
244
- if (!$ sessionId and $ cookie = $ request ->getCookieParams ($ sessName )){
244
+ if (!$ sessionId and $ session_conf [ ' set_cookie ' ] and $ cookie = $ request ->getCookieParams ($ sessName )){
245
245
$ sessionId = $ cookie ;
246
246
}
247
247
// 没有上传sessionId,创建新的会话
248
248
if (!$ sessionId ) {
249
249
$ sessionId = Random::character (32 ); // 生成sessionId
250
- // 设置向客户端响应的Cookie参数
251
- $ response ->setCookie ($ sessName , $ sessionId , time () + $ session_conf ['expire ' ]);
250
+ if ($ session_conf ['set_cookie ' ]){
251
+ // 设置向客户端响应的Cookie参数
252
+ $ response ->setCookie ($ sessName , $ sessionId , time () + $ session_conf ['expire ' ]);
253
+ }
252
254
$ request ->withAttribute ('setSession ' , $ sessName );
253
255
}
254
256
// 存储sessionId方便调用,也可以通过其它方式存储
You can’t perform that action at this time.
0 commit comments