huacnlee / rucaptcha

Captcha Gem for Rails, which generates captcha image by Rust.
https://huacnlee.github.io/rucaptcha
MIT License
695 stars 133 forks source link

Mobile Browser Can Not Request With User Session info #65

Closed charleszhuct closed 6 years ago

charleszhuct commented 6 years ago

First request from mobile browser: Safari or Chrome in iOS I, [2018-07-12T19:19:15.634746 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] Started GET "/rucaptcha/" for 220.248.44.178 at 2018-07-12 19:19:15 +0800 I, [2018-07-12T19:19:15.637015 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] Processing by RuCaptcha::CaptchaController#index as HTML I, [2018-07-12T19:19:15.638189 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] rucapcha : session_id = I, [2018-07-12T19:19:15.638253 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] rucapcha : session.id = I, [2018-07-12T19:19:15.638316 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] rucapcha : session[:session_id] = I, [2018-07-12T19:19:15.638375 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] rucapcha : rucaptcha_sesion_key_key = rucaptcha-session: I, [2018-07-12T19:19:15.638649 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] rucapcha : $redis.get(rucaptcha_sesion_key_key) = I, [2018-07-12T19:19:15.638939 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] rucapcha : RuCaptcha.cache.read(rucaptcha_sesion_key_key) = {:code=>"rqam", :time=>1531394355} I, [2018-07-12T19:19:15.639384 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] Rendered text template (0.1ms) I, [2018-07-12T19:19:15.639543 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] Sent data (0.5ms) I, [2018-07-12T19:19:15.639675 #23750] INFO -- : [8faf25ee-2b3a-4634-b76e-5ba8f0c9a0a3] Completed 200 OK in 3ms (Views: 0.4ms | ActiveRecord: 0.0ms)

Second Request: from Chrome in mac I, [2018-07-12T19:19:19.428124 #23750] INFO -- : [bc11f394-6d5f-4056-9c87-f9efcc12caaf] Started GET "/rucaptcha/" for 220.248.44.178 at 2018-07-12 19:19:19 +0800 I, [2018-07-12T19:19:19.430369 #23750] INFO -- : [bc11f394-6d5f-4056-9c87-f9efcc12caaf] Processing by RuCaptcha::CaptchaController#index as HTML I, [2018-07-12T19:19:19.431884 #23750] INFO -- : [bc11f394-6d5f-4056-9c87-f9efcc12caaf] rucapcha : session_id = 0bdfce54b6d1cab465e2abc48cee91d6 I, [2018-07-12T19:19:19.431973 #23750] INFO -- : [bc11f394-6d5f-4056-9c87-f9efcc12caaf] rucapcha : session.id = 0bdfce54b6d1cab465e2abc48cee91d6 I, [2018-07-12T19:19:19.432050 #23750] INFO -- : [bc11f394-6d5f-4056-9c87-f9efcc12caaf] rucapcha : session[:session_id] = 0bdfce54b6d1cab465e2abc48cee91d6 I, [2018-07-12T19:19:19.432101 #23750] INFO -- : [bc11f394-6d5f-4056-9c87-f9efcc12caaf] rucapcha : rucaptcha_sesion_key_key = rucaptcha-session:0bdfce54b6d1cab465e2abc48cee91d6 I, [2018-07-12T19:19:19.432329 #23750] INFO -- : [bc11f394-6d5f-4056-9c87-f9efcc12caaf] rucapcha : $redis.get(rucaptcha_sesion_key_key) = I, [2018-07-12T19:19:19.432692 #23750] INFO -- : [bc11f394-6d5f-4056-9c87-f9efcc12caaf] rucapcha : RuCaptcha.cache.read(rucaptcha_sesion_key_key) = {:code=>"bfdd", :time=>1531394359}

It can cause many users refresh the same rucaptcha_sesion_key_key: "rucaptcha-session:"