BCJTI / ng2-cookies

Simple library to deal with cookies in Angular2
64 stars 31 forks source link

set does not use Secure #21

Closed sethdorris closed 8 years ago

sethdorris commented 8 years ago

the typings for set does not have the parameter of acceptance for Secure.

sethdorris commented 8 years ago

which means the library as is... you can't set a secure cookie.

sethdorris commented 8 years ago

It looks right here .. but installing from npm may be the cause?

sethdorris commented 8 years ago
/**
 * Class Cookie - Holds static functions to deal with Cookies
 */
export declare class Cookie {
    /**
     * Retrieves a single cookie by it's name
     *
     * @param  {string} name Identification of the Cookie
     * @returns The Cookie's value
     */
    static get(name: string): string;
    /**
     * Retrieves a a list of all cookie avaiable
     *
     * @returns Object with all Cookies
     */
    static getAll(): any;
    /**
     * Save the Cookie
     *
     * @param  {string} name Cookie's identification
     * @param  {string} value Cookie's value
     * @param  {number} expires Cookie's expiration date in days from now. If it's undefined the cookie is a session Cookie
     * @param  {string} path Path relative to the domain where the cookie should be avaiable. Default /
     * @param  {string} domain Domain where the cookie should be avaiable. Default current domain
     */
    static set(name: string, value: string, expires?: number, path?: string, domain?: string): void;
    /**
     * Removes specified Cookie
     *
     * @param  {string} name Cookie's identification
     * @param  {string} path Path relative to the domain where the cookie should be avaiable. Default /
     * @param  {string} domain Domain where the cookie should be avaiable. Default current domain
     */
    static delete(name: string, path?: string, domain?: string): void;
    /**
     * Delete all cookie avaiable
     */
    static deleteAll(path?: string, domain?: string): any;
}

this is ng2-cookies/services/cookies.d.ts after running NPM install, you can see where I am talking about at static set

HerbertNatal commented 8 years ago

hey seth I did the npm install over here, and it comes with the secure param, I have no idea why it is happening with you.. cookie.d.ts and cookie.js has the param

sethdorris commented 8 years ago

I'll see if I can replicate the issue in another repo. Thanks for checking it out @HerbertNatal

shawnstrickland commented 7 years ago

I didn't have this option when I imported with ng2-cookies/ng2-cookies, but when I changed the import to just ng2-cookies I had the secureoptions available to me.