使用谷歌应用程序引擎重新启动浏览器/服务器的会话持久性 [英] session persistance across browser/server restart using google app-engine

查看:100
本文介绍了使用谷歌应用程序引擎重新启动浏览器/服务器的会话持久性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

我正在使用Google AppEngine。

我每次重新启动浏览器时都会收到新的会话ID, /或服务器。

 字符串jSessionId = this.getThreadLocalRequest()。getSession()。getId(); 

最终目标

赢得大奖我' m拍摄的是长期居住的匿名账户。

例如,用户可以执行操作A,代表他们创建一个匿名账户,然后在第二天回来并使用相同的匿名账户进行操作B他们采取行动A(假设他们之间没有清除他们的cookie)。

在某个时候,一旦他们被吸引进来,他们可以决定验证/注册他们的账户,并为他们已经完成的匿名信息做出保证。

解决方案

我最终使用java.util.UUID.randomUUID()。toString()来生成我自己的唯一会话ID。

How do I make sessions persist across browser/server restarts?
I'm using Google AppEngine.
I'm getting a new session id everytime I restart my browser and/or server.

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

End Goal
The big win I'm shooting for is long lived anonymous accounts.
For example, a user can do action A, have an anonymous account created on their behalf, then come back the next day and do action B with the same anonymous account they did action A with(assuming they didn't clear their cookies in between).

And at some point, once they've been drawn in, they can decide to validate/register their account and keep credit for the anonymous stuff they've already done.

解决方案

I ended up using java.util.UUID.randomUUID().toString() to generate my own unique session ID's.

这篇关于使用谷歌应用程序引擎重新启动浏览器/服务器的会话持久性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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