Add warning when session is invalid (#66)
This commit is contained in:
parent
7aa691d1eb
commit
b6c3d3735d
|
@ -9,6 +9,7 @@ module RuCaptcha
|
||||||
# session key of rucaptcha
|
# session key of rucaptcha
|
||||||
def rucaptcha_sesion_key_key
|
def rucaptcha_sesion_key_key
|
||||||
session_id = session.respond_to?(:id) ? session.id : session[:session_id]
|
session_id = session.respond_to?(:id) ? session.id : session[:session_id]
|
||||||
|
warning_when_session_invalid if session_id.blank?
|
||||||
['rucaptcha-session', session_id].join(':')
|
['rucaptcha-session', session_id].join(':')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -73,5 +74,12 @@ module RuCaptcha
|
||||||
end
|
end
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def warning_when_session_invalid
|
||||||
|
Rails.logger.warn "
|
||||||
|
WARNING! The session.id is blank, RuCaptcha can't work properly, please keep session available.
|
||||||
|
More details about this: https://github.com/huacnlee/rucaptcha/pull/66
|
||||||
|
"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue