如何在Parse.com中将数据保存到用户会话

How to save data to user session in Parse.com

本文关键字:保存 数据 用户 会话 Parse com      更新时间:2023-09-26

在后端登录用户后(我使用Parse.com CloudCode),我想在他的会话中将uri保存到他的化身中。我该如何在Parse.com中完成它。我知道有一个对象Parse.Session.current(),但不知道如何使用它。

像parse提供的其他对象一样对待它。

Parse.Session.current().then(function(session) {
    session.set("foo", "bar");
    session.save().then(function() {
        console.log(session.get("foo"));
    });
});

会话CLP应该设置为允许这样做。(应用程序必须设置为需要可撤销会话)。