Rework whole process to use lua-resty-session

Now it depends on https://github.com/bungle/lua-resty-session

But code is cleaner and more secure.