Jul 15, 2014 in Reader & Parser 3305 views
PgwCookie - Cookie plugin for jQuery / Zepto
Source: pgwjs.com
1. INCLUDE JS FILESS
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript" src="pgwcookie.js"></script>
2. JAVASCRIPT
To create a cookie "myCookie" with the value "test":
$.pgwCookie({ name: 'myCookie', value: 'test' });
$.pgwCookie({ name: 'myCookie' });
$.pgwCookie({ name: 'myCookie', value: null });
3. OPTIONS
Important: If you create a cookie with one or more parameters ("path", "domain", "secure", "json" and/or "raw"), please provide the same parameters for an update or a deletion.
Name (required for all actions)
name: 'myCookie'
Value (required for a creation or deletion)
value: 'test' | value: { test: 'example' } | value: null
Path (optional)
path: '/test'
Domain (optional)
domain: 'example.com' | domain: 'test.domain.com'
Expires (optional)
expires: 60
Secure (optional)
secure: true
Json (optional)
json: true
Raw (optional)
raw: true
Tagged with:
pgwcookie
cookie plugin
unique function
json native
cookie
jquery cookie
javascript cookie
browser cookie
Related Articles