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.

    评论

报告相同问题?