Net::WURFL::ScientiaMobile::Cache::Cookie - Cookie-based cache provider for the WURFL Cloud Client
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;
The cookie WURFL Cloud Client Cache Provider. This module reads the user agent capabilities from a HTTP cookie.
new constructor accepts the following named arguments.
The name of the HTTP cookie. It defaults to WurflCloud_Client.
The expiration time in seconds. It defaults to 86400.
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.
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).
Copyright 2012, ScientiaMobile, Inc.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.