Changeset

6938:9df70e9e006b

util.session: What is the identity of a session?
author Kim Alvefur <zash@zash.se>
date Tue, 24 Nov 2015 19:09:51 +0100
parents 6937:f5d2e58fbefa
children 6939:a9ae0c6ac4f4
files util/session.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/session.lua	Tue Nov 24 19:00:43 2015 +0100
+++ b/util/session.lua	Tue Nov 24 19:09:51 2015 +0100
@@ -6,6 +6,13 @@
 	return session;
 end
 
+local function set_id(session)
+	local id = typ .. tostring(session):match("%x+$"):lower();
+	session.id = id;
+	return session;
+end
+
 return {
 	new = new_session;
+	set_id = set_id;
 }