dongli1920 2017-09-06 13:41
浏览 30
已采纳

在Ionic3 App和Joomla之间分享会话

I have Ionic3 App and Joomla Backend (api.php width all required functions)

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?

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)

but same requests from postman, will only generate one session.

  • 写回答

1条回答 默认 最新

  • dousha1873 2017-09-06 13:51
    关注

    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

    http.get(url, { headers: headers, withCredentials: true })
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000