doushi1996 2018-11-20 10:42
浏览 193

动态iframe丢失PHPSESSID cookie

I have a site which is run behind a node proxy. One part of the site loads data using <Query> of the react-apollo library. For some reason, whenever I refresh the page, the PHPSESSID cookie is not maintained and is changed everytime. But if I put the RightPanel component outside of a <Query> tag, session is maintained.

Please help

<Query query={GQL_CURRENT_USER}>
                    {({ loading, error, data }) => {
                        if (loading) return <div>Chargement...</div>;
                        if (error) return <div>Erreur...</div>;

                        // user not exist or problem fetching
                        if (data.User === null) return <div>Error while loading user.</div>

                        return (
                            <div className="main-container">
                                <UserContext.Provider value={{
                                    currentUser: data.User,
                                    currentStructure
                                }}>
                                    <RightPanel />
                                </UserContext.Provider>
                            </div>
                        )
                    }}
                </Query>

Inside RightPanel load dynamically an iframe

    return (
        <main className={classes.root}>
            <div className={classes.container}>
                <Switch>
                    <Route exact path="/">
                        <Redirect to="/user/suivi" />
                    </Route>       
                    <Route render={() => {
                        const hash = window.location.hash.substr(2).split("/");
                        return <LegacyView path={hash}></LegacyView>
                    }}>
                    </Route>
                </Switch>
            </div>
        </main>
    )

LegacyView render

render() {
        return <iframe ref={this.iframe} onLoad={() => this.frameLoaded()} styleName="LegacyView" src={`${LegacyView.BASE_URL}${this.state.url}`} />
    }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器