Code Monkey home page Code Monkey logo

angular-cookie's People

Contributors

blowsie avatar booleanbetrayal avatar graingert avatar ivpusic avatar jobadiniz avatar orangeskins avatar radotzki avatar soviut avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-cookie's Issues

return false if no cookies found

I thought return false, when no cookies were found was better than returning an emptyobject.

I used jquery to check if it was empty though :/

                if ($.isEmptyObject(cookies)){
                    return false;
                }else {
                    return cookies;
                }

Uncaught URIError: URI malformed

The following value of a cookie is throwing error:

%7B%22mediaUrl%22%3A%22http%3A//ireland1.cutvmanifest.api.ottcloudservices.com/smooth/M1_SS/1407418200-1407421680/manifest%22%2C%22laUrl%22%3A%22http%3A//license.totalmovie.com/playready/rightsmanager.asmx%22%2C%22programId%22%3A%22LSC_SAN_19_10497509%22%2C%22programName%22%3A%22Az%20%E9let%20megy%20tov%E1bb%22%2C%22channelId%22%3A%22LCH_SAN_19_2%22%2C%22channelName%22%3A%22M1%22%2C%22mode%22%3A%22normal%22%2C%22castAvailable%22%3Atrue%2C%22chromecast%22%3A%22%22%2C%22castingDevice%22%3A%22%22%2C%22playing%22%3Atrue%7D

The line is:

value = decodeURIComponent(cookie.substring(pos + 1));

Firefox does not remove cookie

I haven't had the opportunity to test or troubleshoot throughly, but using Firefox, we're not able to properly remove the cookie using

$cookie.remove(key, { path: '/some/path' });

Just doesn't work. Any insights?

Create git tags for package version information

Have a look at:
http://bob.yexley.net/creating-and-maintaining-your-own-bower-package/#updatingandmaintenance
and
http://bob.yexley.net/creating-and-maintaining-your-own-bower-package/#githubreleases

This package doesn't have any version information because the repository doesn't have any tags.
This means that when you run bower install -S angular-cookie the configuration file will look like:

{
  "name": "...",
  "version": "...",
  "dependencies": {
    "angular-cookie": "*"
  }
}

because bower info angular-cookie returns No versions available.

Upgrade old dependencies

Hi,

Could you please upgrade dependencies of your module (specifically bower, but not only). Old versions have known high severity vulnerabilities and may cause problems.

Path wildcard?

Hi,

I'm using angular-cookie in a new application to control popup campaigns across multiple sites.

However it seems if we leave domain and path unset, then the module will automatically insert both the domain and also the path.

So if I wanna do a wildcard on path, like /* in terms of the cookie being set generally for the entire domain, and not just a specific page, would this be the correct way to implement this feature?

Thanks for taking your time to build and maintain this awesome module!

Provider version

There is a provider version for this module? I need to check the existence of a cookie inside the .config() in my application.

expire || expires ?

Hello, you have probably "bug" in README

In this usage example
ipCookie(key, value, { expire: 21 });
should be expires, I think.

Best regards
JB

Best approach for using angular-cookie on ng-model?

In the official angular js $cookies module, you can use the cookies on the ng-model, as its is POJ.

Something like this

$scope.cookies = $cookies;
<td>
    <label class="radio-inline">
        <input type="radio" data-ng-model="cookies.animations" data-ng-change="setAnimateClass(true);" value="true"> <span data-translate="FORM.ON">On</span>
    </label>
    <label class="radio-inline">
        <input type="radio" data-ng-model="cookies.animations" data-ng-change="setAnimateClass(false);" value="false"> <span data-translate="FORM.OFF">Off</span>
    </label>
</td>

What is the best way to do this with angular-cookie?

some key:values not saving on secure mode

When I use the {secure:true} option some of the key:values are not stored.
I have 3 different keys, the 3 are saved properly when I don't use the secure option, but only (the shortest) 2 are saved when I use the secure option.
The structure of the object value that is not saved looks something like this:
{
attr_a: {
attr_a_1: someValue_1,
attr_a_2: someValue_2,
attr_a_3: someValue_3,
attr_a_4: someValue_4,
},
attr_b: [
{
attr_b_1: someValue_1,
attr_b_2: someValue_2,
attr_b_3: someValue_3,
attr_b_4: someValue_4,
attr_b_5: someValue_5,
attr_b_6: someValue_6,
attr_b_7: someValue_7,
attr_b_8: someValue_8,
attr_b_9: someValue_9,
},
{
attr_b_1: someValue_1,
attr_b_2: someValue_2,
attr_b_3: someValue_3,
attr_b_4: someValue_4,
attr_b_5: someValue_5,
attr_b_6: someValue_6,
attr_b_7: someValue_7,
attr_b_8: someValue_8,
attr_b_9: someValue_9
},
{
...
}
]
}

Bug with reading cookie set by other libraries

I have experienced strange behaviour on some browsers. The library suddenly stopped working with type error URIError: malformed URI sequence
Stack trace:
cookieFun@............./angular-cookie.js:77:1

The problem comes with wrong assumption that all cookies for that domain is created only by this library and are encoded with encodeURIComponent. In some cases there are some other cookies for the domain created by another scripts which is not encoded on the same way.

The problem could be fixed by replacing:

value = decodeURIComponent(cookie.substring(pos + 1)); /* 77 row */

with:

try {
value = decodeURIComponent(cookie.substring(pos + 1));
} catch (e) {
value = cookie.substring(pos+1);
}

The whole idea to encode cookies seems to be wrong because you can accidentally damage other third party cookies for instance: google analytics cookie.

Cookie Value Modified when trying to read from Cookie

Right now, if you try and read a cookie that's a large number such as 4461381106811793314, when you fetch it using ipCookie('cookie_name') it returns it as 4461381106811793400.

Is it possible to have it not do that?

Cookie settings are overwritten

I had cookie setting constant and I used it to login and logout. But in case of logout date was overrwriten by the module. And it didn't save the cookie afterwards. I think you should use copy of cookie settings passed from user inside your module.

ipcookie get failed on ie 11

Hi there,

Thank for the solution, it works fine on every browsers else than ie 11.

I'm getting an exception line 91 in angular-cookie.js.

Change bower name

It's kind of sketchy to have the difference between the official repo and this one be the absence of a trailing s.

Any thought about changing the bower module name to angular-ipCookie or something with your personal namespace?

can't set multiple key and values in a cookie

I am trying to set multiple keys on a cookie with different key values, it doesn't allow me every time I set another key and value pair it overrides my previous one(key, value).

Document object support

It would be good to mention that objects can be passed as values and they're automatically serialized and deserialized.

FEATURE REQUEST - httpOnly atribute

Hey guys,
can you extend your cookies solution with ability to set the cookie HttpOnly, via config object, passed into creation of the cookie?
Example:

ipCookie('access_token', token, { expires: expireTime, expirationUnit: 'seconds', httpOnly: true });

Using angular-cookie to share cookies across domains

I have 2 AngularJS applications running on my localhost. I haven't transferred it yet to a real domain.

Am I right that if I set domain on both applications to localhost, angular-cookie should be able to share the cookies to my 2 applications?

$cookieStore stopped working under the $scope functions defined in controller

I found a bug using angular-cookies with html5mde(true);

Everything Working fine, expect $cookieStore stopped working under the functions defined in controller $scope, may be because of the .HTACCESS i didn't find any solution, now using "window.localStorage" anybody here have a solution my sample code is follow:

APLLICATION SCRIPT


// APPLICATION SCRIPT
var app = angular.module('starter', ['ngRoute','ngCookies']);

app.config(function($routeProvider, $locationProvider) {

$routeProvider 
  .when('/dashboard', {
templateUrl: 'pages/dashboard.html',
controller: 'dashboardApp'
})  
.otherwise({
redirectTo: '/',
templateUrl: 'pages/login.html',
controller: 'loginApp'
});  
$locationProvider.html5Mode(true).hashPrefix('!'); 
})

app.controller('loginApp', function($scope , $cookieStore ) {

//This working fine
$cookieStore.put('Greet','Welcome to Angular!');

///////////////////////////////////
  $scope.doLogin = function()
  { 
            // Here no cookie has been setting up
            $cookieStore.put('loggedin', true);
};

})

.HTACCESS


#BEGIN
Options +FollowSymLinks


    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^ index.html [L]


#END


Get cookie expiry?

Is there currently any way to check the expiry date of a cookie we set?

Trash cookie when browser closes

Hey man,

I am currently setting a cookie and I am expecting it to be deleted when I quit the browser and re-open, but the cookie seems to persist.

This doesn't seem like the expected behaviour as per the docs.

Is this correct? Could you tell me how it gets deleted?

Thanks!

domain can't work

I just want all website '**.mujishi.com' can user cookie and I wrote the following:
ipCookie('token', token, {expires: 20},{domain:'.mujishi.com'});
and I log in the a.mujishi.com and I can see the cookie in chrome-resources but if I open b.mujishi.com ,I can't get the cookie ,I'm wondering why?Did I write wrong or something?

Object has no method 'toUTCString'

In the given example, when you store the cookie with 3 days we are getting the following error 'Object 3 has no method 'toUTCString'.'
error

Add this repo to npm too please

Hi there

I've fallen a little bit in love with Browserify recently. I find this package incredible useful (thank you) and it's a little bit irritating having to faff about pulling it in with bower.

Can you add this into npm so that I can use it with Browserify? Pretty please.

Thanks

S

Add to Bower registry?

So, I attempted to install angular-cookie through Bower, and after some mass confusion, I noticed this:

$ bower info angular-cookie
bower angular-cookie#*          cached git://github.com/bower/bower.git#1.2.6
bower angular-cookie#*        validate 1.2.6 against git://github.com/bower/bower.git#*

{
  name: 'angular-cookie',
  homepage: 'https://github.com/bower/bower',
  version: '1.2.6'
}

Module naming

Hey,

Thanks for great extension.

Module naming is incoherent. Project called angular-cookie, which looks like it's official angular team extension. If i want to import it to angular module I need to use ivpusic.cookie but then to use it I have to use ipCookie, is it possible to normalize all names to something like:

ipCookie or ivpusicCookie?

Thanks

Add HttpOnly support ?

Hi

I can't find a way to set the HttpOnly config flag for the creation of a secure cookie.

How can I set it ? or is it actually not possible ?

Thanks for this module (far better than ngCookies...)

.remove does not remove cookies set on specific paths.

Not sure if this is a feature or a bug, however if I set a cookie with a specific path, .remove does not have an effect on it, even doe' returning true.

Reproduction steps:

Navigate on a domain with a subpage like: /subpage/

ipCookie('x', 1, { path : '/subpage' });
ipCookie.remove('x') // returns true;
ipCookie('x') // returns 1, I was expecting it to be removed;

Extra info:

I know about the option ipCookie.remove('x', { path : '/subpage' }) however I was expecting from the return value of the remove above, to take effect on the /subpage path as well.

Setting cookie with angular-cookie does not appear on $cookies

#39 seems very similar to this, so I don't know if it's duplicated, if it his. Sorry about that.

So, I have encountered a problem if I set a cookie with:

ipCookie('stuff', 'helloWorld');

I cannot see it with:

$cookies
// or
$cookies.stuff

But, I can't retrieve the values with:

ipCookie
// or
ipCookie('stuff')

It's intentionally that I cannot retrieve cookies with $cookies?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.