dongmin1166 2017-12-12 20:31
浏览 132

JS / Chrome扩展:如何检查登录用户

I've built a Chrome extension and now id' like to integrate it with my current website built in PHP where users have their own account and can save stuff (think something like pinterest)...

Is it possible to drop a cookie from PHP when they login to my website and read it from the Chrome/Js app? I just need to save the unique ID of the user, but I'm not sure if I can read my cookie from a different website...

What's the correct approach?

  • 写回答

1条回答 默认 最新

  • dongling4288 2017-12-12 20:34
    关注

    Do it like this:

    ...
    echo 'var id = ' + $id + ';';
    ...
    

    And use the id variable in JS freely :)

    评论

报告相同问题?

悬赏问题

  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图