11 Commits

Author SHA1 Message Date
20792afda5 改名修正添加插件报错的问题 2023-02-10 09:27:30 +08:00
d05ef468c7 改个名 2023-02-10 09:15:20 +08:00
Ernests Karlsons
b175345c07 Rename npm package 2016-10-07 09:56:35 +02:00
Ernests Karlsons
0e279c1a8a Update Android implementation 2016-10-07 09:53:18 +02:00
Dr. E
2869c4c601 Resolves #2 2014-02-10 10:17:13 +01:00
Dr. E
49fec4f45d Merge branch 'master' of github.com:bez4pieci/Phonegap-Cookies-Plugin 2013-12-05 14:33:14 +01:00
Dr. E
02e609d1fc Update README 2013-12-05 14:33:01 +01:00
Ernests Karlsons
4dfebe4ac1 Merge pull request #1 from leecrossley/patch-1
Copy/paste error ; ) thanx for the fix!
2013-12-02 15:24:25 -08:00
Lee Crossley
878be3fd89 Update description
Pretty sure this wasn't the Cordova device plugin :) Good work, nice idea
2013-12-02 18:36:25 +00:00
Dr. E
e20b26dd74 Updated README 2013-12-02 16:04:55 +01:00
Dr. E
c896dd6514 Updated README 2013-12-02 16:03:50 +01:00
4 changed files with 39 additions and 27 deletions

View File

@@ -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!');
});
```
- - -

View File

@@ -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"
}

View File

@@ -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>

View File

@@ -50,8 +50,6 @@ public class Cookies extends CordovaPlugin {
public void clear() {
Log.v(TAG, "Clearing cookies...");
CookieManager.getInstance().removeAllCookie();
CookieManager.getInstance().removeAllCookies(null);
}
}