Session
A session
Properties
key
Session.key: TKeyThe key
keyInfo
Session.keyInfo: DataStoreKeyInfoThe DataStoreKeyInfo
data
Session.data: TDataThe data
isReleased
Session.isReleased: booleanWhether or not the session has been released.
isReleasing
Session.isReleasing: booleanWhether or not the session is currently being released.
store
Session.store: StoreThe store
released
SignalSession.released: Signal<boolean>Fired whenever the session is released.
The first parameter is a boolean which is true if the data saved, and
false if the data could not be saved, this could be because the session was
stolen by a different server.
session.released:Connect(function(didSave)
print(`Session released! didSave: {didSave}`)
end)
Functions
new
Creates a session with the given key and data
note
You're probably looking for Store:load
update
Session:update() → Promise<()>Updates the session, saving all data and updating the Session.data and Session.keyInfo properties.
This will also release the session if a different server is requesting a release.
This will also stop the autosave in the current autosave cycle.
release
Session:release() → Promise<()>Releases this session.