jbe/bsw@0: --[[-- jbe/bsw@0: key = -- key to be used with tempstore.pop(...) to regain the stored string jbe/bsw@0: tempstore.save( jbe/bsw@0: blob -- string to be stored jbe/bsw@0: ) jbe/bsw@0: jbe/bsw@0: This function stores data temporarily. It is used to restore slot information after a 303 HTTP redirect. It returns a key, which can be passed to tempstore.pop(...) to regain the stored data. jbe/bsw@0: jbe/bsw@0: --]]-- jbe/bsw@0: jbe/bsw@0: function tempstore.save(blob) jbe@214: local key = multirand.string(26, "123456789bcdfghjklmnpqrstvwxyz") jbe/bsw@0: local filename = encode.file_path( jbe@209: WEBMCP_BASE_PATH, 'tmp', "tempstore-" .. key .. ".tmp" jbe/bsw@0: ) jbe/bsw@0: local file = assert(io.open(filename, "w")) jbe/bsw@0: file:write(blob) jbe/bsw@0: io.close(file) jbe/bsw@0: return key jbe@209: end