在 Ionic3 App 和 Joomla 之间共享会话

Share Session Between Ionic3 App and Joomla

我有 Ionic3 应用程序和 Joomla 后端(api.php 宽度所有必需的功能)

我正在使用 HttpStorage 模块连接 api.php,我有成功的请求(user/login、user/profile 等...)但是每次我发出新请求时,我的 api.php 中的会话都会再次生成......但是来自邮递员的相同请求不会生成新会话,为什么?

例如:

如果我将从应用程序登录,我的 joomla 后端中的会话是 正确的,但是如果我将在我的 应用程序[=30] 中使用其他请求=] 然后 session 将再次生成 不应该 )但宽度其他数据(不再 user_id 和会话中的其他标识符)

但是来自 postman 的相同请求只会生成 一个 会话。

这样试试

let options = new RequestOptions({ headers: headers, withCredentials: true });

然后

http.get(url, options)

或 post

let body = JSON.stringify({key: someValue}); // data you want to send to the backend
// let body = JSON.stringify(jsonData); // data you want to send to the backend
http.post(url, body, options)

如果您正在使用 HttpClient

http.get(url, { headers: headers, withCredentials: true })