您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

thinkphp js跨域问题和session

2024/5/6 21:25:39发布34次查看
用的框架是thinkphp
我用ajax发送给后台一个信息,(出现跨域错误,于是,我就加上header('access-control-allow-origin: *');),需要验证session 但是我发现var_export($_session); 是空的
问题:1、在http://localhost/deno/index.php/home/index/personal.html 发送到http://127.0.0.1/deno/index.php/home/item/delete.html 就在一个项目里面,为什么会出现跨域问题
2、怎么解决获取session数据的问题?
回复内容: 用的框架是thinkphp
我用ajax发送给后台一个信息,(出现跨域错误,于是,我就加上header('access-control-allow-origin: *');),需要验证session 但是我发现var_export($_session); 是空的
问题:1、在http://localhost/deno/index.php/home/index/personal.html 发送到http://127.0.0.1/deno/index.php/home/item/delete.html 就在一个项目里面,为什么会出现跨域问题
2、怎么解决获取session数据的问题?
127.0.0.1换成localhost就可以了
怎么解决跨域发送sessionid的问题?
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product