Module: WEBrick::HTTPAuth::SoksUserCookie
- Included in:
- AskForUserName, NoAuthenticationRequired, SiteWidePassword
- Defined in:
- lib/authenticators.rb
Instance Method Summary collapse
Instance Method Details
#add_cookie(request, response) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/authenticators.rb', line 17 def (request,response) = WEBrick::Cookie.new( 'username', request.user ) .path = '/' .expires = Time.now + ( 60 * 60 * 24 * 180 ) # Expires in 180 days response. << end |
#username_from_cookie(request) ⇒ Object
11 12 13 14 15 |
# File 'lib/authenticators.rb', line 11 def (request) = request..find { || .name == 'username' } return .value if return nil end |