mirror of
https://github.com/bez4pieci/Phonegap-Cookies-Plugin
synced 2026-02-19 00:02:44 +08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b175345c07 | ||
|
|
0e279c1a8a | ||
|
|
2869c4c601 | ||
|
|
49fec4f45d | ||
|
|
02e609d1fc | ||
|
|
4dfebe4ac1 | ||
|
|
878be3fd89 | ||
|
|
e20b26dd74 | ||
|
|
c896dd6514 |
14
README.md
14
README.md
@@ -3,19 +3,17 @@ Phonegap Cookies Plugin
|
|||||||
|
|
||||||
Phonegap/Cordova plugin that allows you to clear cookies of the webview. Use it for logging out the user, restart analytics session etc.
|
Phonegap/Cordova plugin that allows you to clear cookies of the webview. Use it for logging out the user, restart analytics session etc.
|
||||||
|
|
||||||
## Why a plugin?
|
## Why a plugin?
|
||||||
|
|
||||||
On Phonegap `document.cookie` is empty, index.html and all other files are loaded with `file://` protocol.
|
On Phonegap `document.cookie` is empty, since index.html and all other files are loaded with `file://` protocol.
|
||||||
Phonegap manages cookies internally, but doesn't expose any function for clearing them.
|
Phonegap manages cookies internally, but doesn't expose any function for clearing them.
|
||||||
|
|
||||||
## Installation:
|
## Installation
|
||||||
|
|
||||||
### Automatically (CLI / Plugman)
|
|
||||||
|
|
||||||
Cookies is compatible with [Cordova Plugman](https://github.com/apache/cordova-plugman) and ready for the [PhoneGap 3.0 CLI](http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface_add_features), here's how it works with the CLI:
|
Cookies is compatible with [Cordova Plugman](https://github.com/apache/cordova-plugman) and ready for the [PhoneGap 3.0 CLI](http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface_add_features), here's how it works with the CLI:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ phonegap local plugin add https://github.com/bez4pieci/Cookies.git
|
$ phonegap local plugin add https://github.com/bez4pieci/Phonegap-Cookies-Plugin.git
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -25,3 +23,7 @@ window.cookies.clear(function() {
|
|||||||
console.log('Cookies cleared!');
|
console.log('Cookies cleared!');
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- - -
|
||||||
|
|
||||||
|
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||||
40
package.json
40
package.json
@@ -1,13 +1,29 @@
|
|||||||
{
|
{
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"name": "com.bez4pieci.cookies",
|
"name": "cordova-remove-cookies",
|
||||||
"cordova_name": "Cookies",
|
"cordova_name": "Cookies",
|
||||||
"description": "Cordova Cookies Plugin",
|
"description": "Cordova Cookies Plugin",
|
||||||
"license": "Apache 2.0",
|
"license": "Apache 2.0",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"cordova",
|
"cordova",
|
||||||
"phonegap",
|
"phonegap",
|
||||||
"cookies"
|
"cookies"
|
||||||
],
|
],
|
||||||
"engines": []
|
"engines": [],
|
||||||
}
|
"cordova": {
|
||||||
|
"id": "com.bez4pieci.cookies",
|
||||||
|
"platforms": [
|
||||||
|
"ios",
|
||||||
|
"android"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/bez4pieci/Phonegap-Cookies-Plugin.git"
|
||||||
|
},
|
||||||
|
"author": "Ernests Karlsons",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/bez4pieci/Phonegap-Cookies-Plugin/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/bez4pieci/Phonegap-Cookies-Plugin#readme"
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
id="com.bez4pieci.cookies" version="0.0.1">
|
id="com.bez4pieci.cookies" version="0.0.1">
|
||||||
<name>Cookies</name>
|
<name>Cookies</name>
|
||||||
<description>Cordova Device Plugin</description>
|
<description>Phonegap/Cordova plugin that allows you to clear cookies of the webview. Use it for logging out the user, restart analytics session etc.</description>
|
||||||
<license>MIT</license>
|
<license>MIT</license>
|
||||||
<keywords>cordova,phonegap,cookies</keywords>
|
<keywords>cordova,phonegap,cookies</keywords>
|
||||||
|
|
||||||
@@ -14,8 +14,6 @@
|
|||||||
<clobbers target="cookies" />
|
<clobbers target="cookies" />
|
||||||
</js-module>
|
</js-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<platform name="ios">
|
<platform name="ios">
|
||||||
<config-file target="config.xml" parent="/*">
|
<config-file target="config.xml" parent="/*">
|
||||||
<feature name="Cookies">
|
<feature name="Cookies">
|
||||||
@@ -33,6 +31,6 @@
|
|||||||
</feature>
|
</feature>
|
||||||
</config-file>
|
</config-file>
|
||||||
|
|
||||||
<source-file src="src/android/Cookies.java" target-dir="com/bez4pieci/cookies" />
|
<source-file src="src/android/Cookies.java" target-dir="src/com/bez4pieci/cookies" />
|
||||||
</platform>
|
</platform>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ public class Cookies extends CordovaPlugin {
|
|||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
Log.v(TAG, "Clearing cookies...");
|
Log.v(TAG, "Clearing cookies...");
|
||||||
CookieManager.getInstance().removeAllCookie();
|
CookieManager.getInstance().removeAllCookies(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user