The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::WURFL::ScientiaMobile::Cache::Cookie - Cookie-based cache provider for the WURFL Cloud Client

SYNOPSIS

    use Net::WURFL::ScientiaMobile;
    use Net::WURFL::ScientiaMobile::Cache::Cookie;
    
    my $cache = Net::WURFL::ScientiaMobile::Cache::Cookie->new;
    my $scientiamobile = Net::WURFL::ScientiaMobile->new(
        api_key => '...',
        cache   => $cache,
    );
    
    # ...later, in your HTTP request handler...
    $cache->env($env);
    $scientiamobile->detectDevice($env);
    my $new_cookies = $cache->cookies;

DESCRIPTION

The cookie WURFL Cloud Client Cache Provider. This module reads the user agent capabilities from a HTTP cookie.

CONSTRUCTOR

The new constructor accepts the following named arguments.

The name of the HTTP cookie. It defaults to WurflCloud_Client.

cache_expiration

The expiration time in seconds. It defaults to 86400.

METHODS

env

Use this method to set the Plack env when you get a new request. This will link the cache to the request data, allowing for cookie inspection.

cookies

Use this method to retrieve the cookie(s) that you have to send back to your client. Cookies are returned as a hashref whose values are the cookie contents (your implementation can decide the other attributes of the cookie at serialization time).

SEE ALSO

Net::WURFL::ScientiaMobile, Net::WURFL::ScientiaMobile::Cache

COPYRIGHT & LICENSE

Copyright 2012, ScientiaMobile, Inc.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.