gwt rpc中的会话ID cookie [英] session id cookie in gwt rpc

查看:299
本文介绍了gwt rpc中的会话ID cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我正在滚动我自己的会话代码,在java中生成唯一和安全的会话ID cookie的正确方法是什么。

Assuming I'm rolling my own session code, what's the right way to generate a unique and secure session id cookie in java.

我正在使用gwt和google app-engine平台。

I'm using gwt and the google app-engine platform.

如何使浏览器/服务器重新启动时会话保持不变?

How do I make sessions persist across browser/server restarts?

推荐答案

在GWT中使用Servlet会话

在远程服务实现类中:

String jSessionId=this.getThreadLocalRequest().getSession().getId();

在客户代码中:

String jSessionId=Cookies.getCookie("JSESSIONID");

Enabling_Sessions

appengine-web.xml

appengine-web.xml

<sessions-enabled>true</sessions-enabled>

这篇关于gwt rpc中的会话ID cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆