# File lib/ramaze/helper/csrf.rb, line 120 def generate_csrf_token(args = {}) ttl = args[:ttl] || (15 * 60) random = SecureRandom.random_bytes(512) time = Time.now.to_f token = Digest::SHA512.hexdigest(random + time.to_s) # Time to store all the data we want to check later. session[:_csrf] = { :time => time.to_i, :token => token, :ip => request.ip, :agent => request.env['HTTP_USER_AGENT'], :host => request.host, :ttl => ttl } return end