Class | Web::CookieManager
In: | lib/facets/more/cookie.rb
Parent: | Object

## Web::CookieManager Class

Load, save, parse and send cookies.

### Usage

      ## initialize
      cm = Web::CookieManager.new("/home/foo/bar/cookie")

      ## load cookie data
      cm.load_cookies()

      ## parse cookie from string (maybe "Set-Cookie:" header)
      cm.parse(str)

      ## send cookie data to url
      f.write(cm.find(url))

      ## save cookie to cookiefile
      cm.save_cookies()

### Class Methods

     -- CookieManager::new(file=nil)

         create new CookieManager. If a file is provided,
         use it as cookies' file.

### Methods

     -- CookieManager#save_cookies(force = nil)

         save cookies' data into file. if argument is true,
         save data although data is not modified.

     -- CookieManager#parse(str, url)

         parse string and store cookie (to parse HTTP response header).

     -- CookieManager#find(url)

         get cookies and make into string (to send as HTTP request header).

     -- CookieManager#add(cookie)

         add new cookie.

     -- CookieManager#load_cookies()

         load cookies' data from file.

### Methods

add check_cookie_accept_domain check_expired_cookies find load_cookies new parse save_all_cookies save_cookies

### Included Modules

CookieUtils

### Classes and Modules

Class Web::CookieManager::Error
Class Web::CookieManager::ErrorOverrideOK
Class Web::CookieManager::NoDotError
Class Web::CookieManager::SpecialError

### Constants

SPECIAL_DOMAIN | = | [".com",".edu",".gov",".mil",".net",".org",".int"]

### Attributes

accept_domains | [RW] |
cookies | [RW] |
cookies_file | [RW] |
netscape_rule | [RW] |
reject_domains | [RW] |

### Public Class methods

new(file=nil)

### Public Instance methods

add(cookie)
check_cookie_accept_domain(domain)
check_expired_cookies()
find(url)
load_cookies()
parse(str, url)
save_all_cookies(force = nil, save_unused = true, save_discarded = true)
save_cookies(force = nil)

[Validate]