From 8531abc5bd8eb48855a1a967d0e5fc129b526b0e Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 5 Dec 2024 14:58:43 +0100 Subject: [PATCH] Use rails's DSL for time ago --- lib/hotwire_spark/action_cable/persistent_cable_middleware.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hotwire_spark/action_cable/persistent_cable_middleware.rb b/lib/hotwire_spark/action_cable/persistent_cable_middleware.rb index cbf53e75..50161d33 100644 --- a/lib/hotwire_spark/action_cable/persistent_cable_middleware.rb +++ b/lib/hotwire_spark/action_cable/persistent_cable_middleware.rb @@ -37,7 +37,7 @@ def append_cookie(existing_cookies) end def disable_action_cable_restarts_cookie - expiration = (Time.now + RESTARTS_SUPPRESSED_GRACE_PERIOD).utc + expiration = RESTARTS_SUPPRESSED_GRACE_PERIOD.from_now.utc "#{COOKIE_NAME}=true; Path=/; Expires=#{expiration.httpdate}; HttpOnly" end end