Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pudretediablo/cordova-plugin-oreo
Add cookies to your Cordova Project
https://github.com/pudretediablo/cordova-plugin-oreo
cookies cordova cordova-android cordova-ios cordova-plugin ionic javascript
Last synced: 29 days ago
JSON representation
Add cookies to your Cordova Project
- Host: GitHub
- URL: https://github.com/pudretediablo/cordova-plugin-oreo
- Owner: PudreteDiablo
- Created: 2020-12-19T22:06:05.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-05T02:52:56.000Z (over 3 years ago)
- Last Synced: 2024-10-02T02:56:35.436Z (about 1 month ago)
- Topics: cookies, cordova, cordova-android, cordova-ios, cordova-plugin, ionic, javascript
- Language: JavaScript
- Homepage:
- Size: 182 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Oreo.js for Cordova
### Add cookies to your Cordova Project.[![npm version](https://badge.fury.io/js/cordova-plugin-oreo.svg)](//npmjs.com/package/cordova-plugin-oreo)
[![Cordova](https://img.shields.io/badge/Cordova-Yes-blue.svg)](#)
[![Ionic](https://img.shields.io/badge/Android%20Tested-Yes-green.svg)](#)
[![Ionic](https://img.shields.io/badge/Ionic%20Tested-No-gray.svg)](#)
[![Ionic](https://img.shields.io/badge/iOS%20Tested-No-gray.svg)](#)------
**Note:** This plugin is an adapted version of the original [oreo.js package](https://github.com/PudreteDiablo/oreo.js).
## Installation
#### Plugin Manager
```
cordova plugin add cordova-plugin-oreo
```#### CDN (Recommended)
```html```
------
## Examples
```js
// WRITE A COOKIE [v]
// WILL EXPIRE IN A MONTH BY DEFAULT [v]
oreo( 'my-cookie-key', 'my-cookie-value' ) ;// WRITE A COOKIE WITH EXPIRATION-DATE AND PATH [v]
// WILL EXPIRE IN A YEAR [v]
expiration = new Date( ) ;
expiration = expiration.setFullYear( expiration.getFullYear( ) + 1 ) ;
// OR
expiration = 365 ; // EXPIRATION IN DAYS IS ACCEPTABLE TOO.
oreo( 'my-cookie-key', 'my-cookie-value', { expires : expiration, path : '/blog/' } ) ;// READ COOKIE [v]
var cookie = oreo( 'my-cookie-key' ) ;// REMOVE COOKIE [v]
oreo.remove( 'my-cookie-key' ) ;// CLEAR ALL [v]
oreo.clear( ) ;
```As programmer, I prefer to look at examples to understand how a package works. So I make a few examples with comments in the [examples folder](https://github.com/PudreteDiablo/oreo.js/tree/master/examples).
------
## Documentation
Check the updated [documentation page](https://pudretediablo.github.io/oreo.js) to see all available *Methods*, *Properties* and *Events* of oreo.jsAlso the docs page have useful information such as devlog, tips, storage-info and other stuff, so check it out.