首页 > 解决方案 > 有没有办法在我们通过重定向 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 应用的网址

标签: rdjangoshiny

解决方案


推荐阅读