lib/rodauth/features/select_account.rb in rodauth-select-account-0.1.2 vs lib/rodauth/features/select_account.rb in rodauth-select-account-0.1.3
- old
+ new
@@ -60,11 +60,11 @@
::Rack::Utils.delete_cookie_header!(response.headers, require_selected_account_cookie_key, opts)
return
end
opts[:value] = true
- opts[:expires] = Time.now + require_selected_account_cookie_interval
+ opts[:expires] = Time.now + require_selected_account_cookie_interval if require_selected_account_cookie_interval
opts[:httponly] = true unless opts.key?(:httponly)
opts[:secure] = true unless opts.key?(:secure) || !request.ssl?
::Rack::Utils.set_cookie_header!(response.headers, require_selected_account_cookie_key, opts)
@@ -175,10 +175,10 @@
accounts_cookie << account_id
opts = Hash[accounts_cookie_options]
opts[:value] = accounts_cookie.join(",")
- opts[:expires] = Time.now + accounts_cookie_interval
+ opts[:expires] = Time.now + accounts_cookie_interval if accounts_cookie_interval
opts[:path] = "/" unless opts.key?(:path)
opts[:httponly] = true unless opts.key?(:httponly)
opts[:secure] = true unless opts.key?(:secure) || !request.ssl?
::Rack::Utils.set_cookie_header!(response.headers, accounts_cookie_key, opts)
end