实际上我的问题很荒谬。 我通过添加标题提供安全性。 当我添加加密数据时,浏览器会出错。 p>
代码源输出: p>
标题:{
“授权” :“���6���/��O��u�f��v2��”,
},
code> pre>
浏览器检测到: p>
标题:{
“授权”:“���6��� /��O��
u�f��v2��“,
},
code> pre>
PHP代码: p>
标题:{
“授权”:“<?php echo $ _SESSION ['sID'];?>”,
},
code> pre>
我的会话类: p>
类会话{
公共函数__construct(){
if(session_status()== PHP_SESSION_NONE){
session_start( );
}
\ self :: Encrypt('sID',session_id());
}
公共静态函数Encrypt($ Name,$ Value){
if(!is_null($ Value) ){
$ _S ESSION [$ Name] = openssl_encrypt($ Value,Config :: Get('Encrypt / Type'),Config :: Get('Encrypt / Password'),OPENSSL_RAW_DATA,Config :: Get('Encrypt / Session'));
返回$ _SESSION [$ Encrypt];
}
返回false;
}
}
code> pre>
有什么问题? 有没有人有想法? 最好的问候! p>
另外: str_replace code>和 trim code>尝试了它的功能。 p>
div>