add cookie, timeout and default encode in helper.