r - 有没有办法在我们通过重定向 url 传递的 RShiny 应用程序中获取 cookie 值
问题描述
我在 django 框架中有 Web 应用程序并托管了 n azure。我在 RShiny 中有另一个 Web 应用程序,它托管在 AWS 中。我们正在为 django 应用程序进行适当的身份验证过程。一旦用户登录 django 应用程序,我们希望用户应该能够访问 RShiny 应用程序而无需再次要求身份验证。为此,我们在重定向 url 为 Rshiny 的 cookie 中传递了一个令牌值。但我们无法在 Rshiny 应用程序中获取 cookie。这两个 cookie 在 chrome 的开发者工具中都不可见。我们在用户点击按钮后编写的 django 代码
def buttonclick(request):
response=redirect('http://example.com')
expires=datetime.now()+timedelta(seconds=480)
response.set_cookie('token',value='tokenmmx',expires=expires)
return response
“ http://example.com ” 是 Rshiny 应用的网址
解决方案
推荐阅读
- php - 在文本文件中搜索字符串并在 PHP 中出现空格后打印
- ajax - 在 Ajax 代码中使用 if 条件时出错
- mysql - 连接两个大表时性能不佳
- php - 如果购买的商品缺货,则 WooCommerce 最低订单量
- python - 为什么在 python 中使用方括号和 if 不会出错
- javascript - PHP bootstrap 4删除按钮不获取ID
- python - Python中使用Tkinter的身份验证系统
- apache-spark - 得到这个错误:不匹配的输入'来自'期待
而 Spark SQL - python-3.x - 从外部python脚本调用需要root权限的python函数(pynq库)不断崩溃
- html - 如何从包含的组件中调用容器组件