util/session.lua
author Kim Alvefur <zash@zash.se>
Tue, 24 Nov 2015 19:09:51 +0100
changeset 6941 9df70e9e006b
parent 6940 f5d2e58fbefa
child 6942 a9ae0c6ac4f4
permissions -rw-r--r--
util.session: What is the identity of a session?


local function new_session(typ)
	local session = {
		type = typ .. "_unauthed";
	};
	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;
}