weixin_33674976 2011-04-11 09:26 采纳率: 0%
浏览 26

在Ajax调用中通过ID获取会话

Is there a way to have access to session in a AJAX call made to a JAVA server.

On the server, the request object has both the session and cookies properties NULL.

I can pass though the session id as a parameter, but how can I access the session by ID?

Edit

Using session.getSession(false); returns null, while session.getSession(true); obviously returns a new session, with another id.

  • 写回答

3条回答 默认 最新

  • weixin_33737774 2011-04-11 09:30
    关注

    It sounds like you don't have a session!

    Make sure when the load containing the AJAX script, the session is created on the server.

    session.getSession(true);
    

    If this is stored as a cookie, then your AJAX call will submit it back to the server when it fires.

    评论

报告相同问题?

悬赏问题

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