duanpu8830 2011-11-01 23:59
浏览 30
已采纳

龙卷风饼干

I am using Apache and PHP as my front-end server and Tornado as my back-end to handle my requests. When allowing a user to login I want to create cookies for the username and password. If I do it as follows:

self.set_cookie('emailaddress', email_address, domain='mydomain.com', expires=None, path='/', expires_days=expire_d)
self.set_cookie('password', newpass, domain='mydomain.com', expires=None, path='/', expires_days=expire_d)

Nothing is created. But if I do:

self.set_cookie('emailaddress', email_address) 
self.set_cookie('password', newpass) 

It works. But than even though the cookies which I can see from Firefox and Firebug but PHP on my front-end doesn't recognize them. Also I know its not from cross-domain because I have my Tornado server Proxy through Apache.

  • 写回答

1条回答 默认 最新

  • dpnv33177 2011-11-06 17:40
    关注

    Yes, it seems like the problem is related to subdomains if you are using them to route between Tornado and PHP, without details on this it's hard to tell how to fix it.

    But in general maybe it will be a good idea to just map Tornado to some relative url on a main domain and do not mess with subdomains?

    P.S.: storing login/password pairs in cookies in plain text is not secure, I'd recomend to use unique session id mapped to users via common database between PHP and Tornado.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿