Giter Site home page Giter Site logo

export lib methods about cookie-parser HOT 9 CLOSED

Industrial avatar Industrial commented on April 28, 2024
export lib methods

from cookie-parser.

Comments (9)

dougwilson avatar dougwilson commented on April 28, 2024

Yea, I was thinking the same thing, that perhaps the stuff in parse should be exported.

/cc @defunctzombie @jonathanong

from cookie-parser.

joewagner avatar joewagner commented on April 28, 2024

Sorry about that! My cat stepped on the mouse and closed the issue!

from cookie-parser.

joewagner avatar joewagner commented on April 28, 2024

I was going to comment that signedCookies is intended to be private. If its changed to be reachable, maybe prepend an _ to the name, so people understand that using it outside of this module is not recommended?

from cookie-parser.

dougwilson avatar dougwilson commented on April 28, 2024

@joewagner I think the thing is, we may want it to be public. So in essence, this library will create and set cookies in a certain way and people want to be able to read those cookies without actually straight-up using the middleware to read all cookies. Typically I see people using those functions for websockets, but I don't known enough about websockets to know if they are even doing the correct thing anyway (as far as I know, everyone could just be copy-pasting from everyone else).

from cookie-parser.

joewagner avatar joewagner commented on April 28, 2024

@dougwilson That makes sense. I hadn't though about that type of use case for this lib.

from cookie-parser.

defunctzombie avatar defunctzombie commented on April 28, 2024

I think having a function to parse signed cookies would be ok. Could even be a "method" of the middleware function returned when you create a cookie parser that way you don't need to keep passing in the secret.

from cookie-parser.

dougwilson avatar dougwilson commented on April 28, 2024

Could even be a "method" of the middleware function returned

I like that idea, actually :)

from cookie-parser.

dougwilson avatar dougwilson commented on April 28, 2024

Actually, this library is just to "parse cookies" as a middleware. The generation of the JSON/signed cookies should be a separate module, and this module should simply be a wrapper to use that other module to parse the cookies.

from cookie-parser.

Industrial avatar Industrial commented on April 28, 2024

That sounds like a better idea.
On Jun 8, 2014 6:58 PM, "Douglas Christopher Wilson" <
[email protected]> wrote:

Actually, this library is just to "parse cookies" as a middleware. The
generation of the JSON/signed cookies should be a separate module, and this
module should simply be a wrapper to use that other module to parse the
cookies.


Reply to this email directly or view it on GitHub
#7 (comment)
.

from cookie-parser.

Related Issues (20)

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.