简体   繁体   English

Ionic3 App和Joomla之间的共享会话

[英]Share Session Between Ionic3 App and Joomla

I have Ionic3 App and Joomla Backend (api.php width all required functions) 我有Ionic3 App和Joomla后端(api.php宽度是所有必需的功能)

I am using Http , and Storage modules to connect api.php, I have Successful requests (user/login, user/profile etc..) but every time I am making new request, session in my api.php It is generated again..... but same requests from postman not generates new session, why? 我正在使用HttpStorage模块来连接api.php,我有成功的请求(用户/登录,用户/配置文件等。),但是每次我发出新请求时,api.php中的会话都会再次生成。 ....但是邮递员的相同请求未生成新会话,为什么?

For example: 例如:

If I will log-in from app , session in my joomla backend is right , but if I will use other request in my app then session will generated again ( should not ) but width other data (no more user_id and other identifers in session) 如果我要从app登录,则在我的joomla后端中的会话是正确的 ,但是如果我将在我的应用中使用其他请求,则会话再次生成( 不应 ),但会宽度其他数据(会话中没有更多的user_id和其他标识符)

but same requests from postman , will only generate one session. 但是邮递员的相同请求只会产生一个会话。

Try like this 这样尝试

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

then 然后

http.get(url, options)

or for 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)

if you are usign HttpClient 如果您使用的是HttpClient

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM