mirror of
https://github.com/bez4pieci/Phonegap-Cookies-Plugin
synced 2026-02-19 00:02:44 +08:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 20792afda5 | |||
| d05ef468c7 | |||
|
|
b175345c07 | ||
|
|
0e279c1a8a | ||
|
|
2869c4c601 | ||
|
|
49fec4f45d | ||
|
|
02e609d1fc | ||
|
|
4dfebe4ac1 | ||
|
|
878be3fd89 | ||
|
|
e20b26dd74 | ||
|
|
c896dd6514 |
12
README.md
12
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.
|
||||
|
||||
## 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.
|
||||
|
||||
## Installation:
|
||||
|
||||
### Automatically (CLI / Plugman)
|
||||
## Installation
|
||||
|
||||
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
|
||||
$ cordova plugin add git+https://m.shuto.cn:8681/public/Phonegap-Cookies-Plugin.git
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -25,3 +23,5 @@ window.cookies.clear(function() {
|
||||
console.log('Cookies cleared!');
|
||||
});
|
||||
```
|
||||
|
||||
- - -
|
||||
|
||||
40
package.json
40
package.json
@@ -1,13 +1,29 @@
|
||||
{
|
||||
"version": "0.0.1",
|
||||
"name": "com.bez4pieci.cookies",
|
||||
"cordova_name": "Cookies",
|
||||
"description": "Cordova Cookies Plugin",
|
||||
"license": "Apache 2.0",
|
||||
"keywords": [
|
||||
"cordova",
|
||||
"phonegap",
|
||||
"cookies"
|
||||
],
|
||||
"engines": []
|
||||
}
|
||||
"version": "0.0.2",
|
||||
"name": "cordova-remove-cookies",
|
||||
"cordova_name": "Cookies",
|
||||
"description": "Cordova Cookies Plugin",
|
||||
"license": "Apache 2.0",
|
||||
"keywords": [
|
||||
"cordova",
|
||||
"phonegap",
|
||||
"cookies"
|
||||
],
|
||||
"engines": [],
|
||||
"cordova": {
|
||||
"id": "cordova-remove-cookies",
|
||||
"platforms": [
|
||||
"ios",
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://m.shuto.cn:8681/public/Phonegap-Cookies-Plugin.git"
|
||||
},
|
||||
"author": "Ernests Karlsons",
|
||||
"bugs": {
|
||||
"url": "https://m.shuto.cn:8681/public/Phonegap-Cookies-Plugin/issues"
|
||||
},
|
||||
"homepage": "https://m.shuto.cn:8681/public/Phonegap-Cookies-Plugin#readme"
|
||||
}
|
||||
|
||||
10
plugin.xml
10
plugin.xml
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
id="com.bez4pieci.cookies" version="0.0.1">
|
||||
id="cordova-remove-cookies" version="0.0.1">
|
||||
<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>
|
||||
<keywords>cordova,phonegap,cookies</keywords>
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
<clobbers target="cookies" />
|
||||
</js-module>
|
||||
|
||||
|
||||
|
||||
<platform name="ios">
|
||||
<config-file target="config.xml" parent="/*">
|
||||
<feature name="Cookies">
|
||||
@@ -33,6 +31,6 @@
|
||||
</feature>
|
||||
</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>
|
||||
</plugin>
|
||||
</plugin>
|
||||
|
||||
@@ -50,8 +50,6 @@ public class Cookies extends CordovaPlugin {
|
||||
|
||||
public void clear() {
|
||||
Log.v(TAG, "Clearing cookies...");
|
||||
CookieManager.getInstance().removeAllCookie();
|
||||
CookieManager.getInstance().removeAllCookies(null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user