Commit 0e7a6bae authored by Ismail Halili's avatar Ismail Halili
Browse files

add session counter

parent 9ec6d7a5
class ApplicationController < ActionController::Base
before_action :count_requests
def count_requests
session[:counter] = 0 if session[:counter].nil?
session[:counter] += 1
end
end
......@@ -34,6 +34,8 @@
<p>This Demo App offers no Login. But a session-cookie <kbd><%=
Rails.application.config.session_options[:key] %></kbd> is still created
by rails and set for each visitor.</p>
<p>you have made <%= session[:counter] %> requests in session <%= session.id %>
</p>
</div>
</footer>
</body>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment