module Authlogic::Session::Cookies::Config
Configuration for the cookie feature set.
Public Instance Methods
httponly(value = nil)
click to toggle source
Should the cookie be set as httponly? If true, the cookie will not be accessible from javascript
-
Default:
true -
Accepts:
Boolean
# File lib/authlogic/session/cookies.rb, line 71 def httponly(value = nil) rw_config(:httponly, value, true) end
Also aliased as: httponly=
remember_me(value = nil)
click to toggle source
If sessions should be remembered by default or not.
-
Default:
false -
Accepts:
Boolean
# File lib/authlogic/session/cookies.rb, line 42 def remember_me(value = nil) rw_config(:remember_me, value, false) end
Also aliased as: remember_me=
remember_me_for(value = nil)
click to toggle source
The length of time until the cookie expires.
-
Default:
3.months -
Accepts:
Integer, length of time in seconds, such as 60 or 3.months
# File lib/authlogic/session/cookies.rb, line 51 def remember_me_for(value = nil) rw_config(:remember_me_for, value, 3.months) end
Also aliased as: remember_me_for=
same_site(value = nil)
click to toggle source
Should the cookie be prevented from being send along with cross-site requests?
-
Default:
nil -
Accepts:
String, one of nil, 'Lax' or 'Strict'
# File lib/authlogic/session/cookies.rb, line 81 def same_site(value = nil) unless VALID_SAME_SITE_VALUES.include?(value) msg = "Invalid same_site value: #{value}. Valid: #{VALID_SAME_SITE_VALUES.inspect}" raise ArgumentError.new(msg) end rw_config(:same_site, value) end
Also aliased as: same_site=
secure(value = nil)
click to toggle source
Should the cookie be set as secure? If true, the cookie will only be sent over SSL connections
-
Default:
true -
Accepts:
Boolean
# File lib/authlogic/session/cookies.rb, line 61 def secure(value = nil) rw_config(:secure, value, true) end
Also aliased as: secure=