javascript - Why is the cookie not brought?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-19 10:21:18
0
2
622

1. Request the app backend address http://192.168.101.76:1080/te... in the webview of an app, and return the html page as follows
<!DOCTYPE HTML>

<html>
<head>
    <title>测试</title>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
</head>
<body>
</body>
<script src="http://test.money.com/static/result.js"></script>
</html>

2. Issue a jsonp request https://wxwap.money.com/AppAu... in result.js. The return result is as follows, in which the response Header returns the set-cookie field

3. result.js sends another jsonp request https://wxwap.money.com/Inves...,
See that the request header does not bring the cookie set in step 2

Want to know why I didn’t bring cookies? What could be the reason?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
Peter_Zhu

If you want to bring cookies when making cross-domain requests using ajax, add a sentencewithcredentials: true. I don’t know if this is your problem..
XMLHttpRequest.withCredentials

左手右手慢动作

Post the js code and have a look

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template