restore()
public
Restore session state from the session’s FileStore file.
Returns the session state as a hash.
Show source
def restore
unless @hash
@hash = {}
begin
lockf = File.open(@path+".lock", "r")
lockf.flock File::LOCK_SH
f = File.open(@path, 'r')
for line in f
line.chomp!
k, v = line.split('=',2)
@hash[CGI::unescape(k)] = Marshal.restore(CGI::unescape(v))
end
ensure
f.close unless f.nil?
lockf.close if lockf
end
end
@hash
end