这似乎是一个愚蠢的问题,但我刚开始接触飞镖和需要验证这与您可能使用PHP与$ _SESSION数组做什么用户sesions ...飞镖中有会议吗?
所以我写一个基本服务器后端和前端,并且需要验证通过XMLHttpRequest进入的一些请求。后端根据给定的前端是否经过身份验证发回JSON。在某些情况下,前端可以更新DOM,但只有才能通过身份验证。
不知道如果我解释得很好...
任何意见将不胜感激!
谢谢!
这似乎是一个愚蠢的问题,但我刚开始接触飞镖和需要验证这与您可能使用PHP与$ _SESSION数组做什么用户sesions ...飞镖中有会议吗?
所以我写一个基本服务器后端和前端,并且需要验证通过XMLHttpRequest进入的一些请求。后端根据给定的前端是否经过身份验证发回JSON。在某些情况下,前端可以更新DOM,但只有才能通过身份验证。
不知道如果我解释得很好...
任何意见将不胜感激!
谢谢!
会话是不应该成为任何语言的一部分的高级功能。你可以通过推动类似的东西来包含会话功能。
Map<String, int> sessions = {'abcdef12345' : 42}; // exists in e.g. datastore and is managed by an authentication routine
String authenticationToken = 'abcdef12345'; // comes from the request
if(sessions.containsKey(authenticationToken)) {
print('User ${sessions[authenticationToken]} is at least authenticated but might not have the appropriate rights to perform this operation.');
} else {
print('Not authenticated.');
}
好点 - 好吧,我会尝试通过POST。谢谢! – J99 2012-08-08 19:30:13
包shelf_auth提供了一个很好的全自动JwtSessionHandler
执行会话处理的解决方案shelf
var authMiddleware = authenticate([new RandomAuthenticator()],
new JwtSessionHandler('super app', 'shhh secret', testLookup));
我搜索镖服务器端Web框架,这将落实会议,我发现这一点:https://github.com/lvivski/start可能有其他人。 – 2012-08-08 17:38:22