CORS cookie credentials from mobile WebView loaded locally with file://

前端 未结 6 2417
半阙折子戏
半阙折子戏 2020-11-29 03:24

Bear with me, this one needs a bit of explanation.

I am helping to build a hybrid mobile web app. The main codebase is HTML5 and JavaScript, which will be wrapped in

6条回答
  •  猫巷女王i
    2020-11-29 04:00

    On php side for example you need set this:

    header('Access-Control-Allow-Origin: *');
    header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
    header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization, X-Request-With, Set-Cookie, Cookie, Bearer');
    header('Access-Control-Allow-Credentials: true');
    // header('Cookie: PHPSESSID='.$_COOKIE['PHPSESSID']);
    

提交回复
热议问题