Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cookies(req, res, [options]) #43

Closed
jonathanong opened this issue Jun 5, 2014 · 5 comments
Closed

cookies(req, res, [options]) #43

jonathanong opened this issue Jun 5, 2014 · 5 comments
Assignees

Comments

@jonathanong
Copy link
Member

i think setting the options every time you .get() or .set() the cookies is pretty annoying. we should able to use default options passed to the constructor.

@dougwilson
Copy link
Contributor

Makes sense.

@jonathanong
Copy link
Member Author

going to change this to:

var cookies = new Cookies([options])

app.use(function (req, res, next) {
  req.cookies = res.cookies = cookies(req, res)
  next()
})

@Fishrock123 Fishrock123 added this to the 1.0.0 milestone Jun 19, 2014
@shash7
Copy link

shash7 commented Sep 12, 2014

This still isn't implement eh?

@jonathanong
Copy link
Member Author

#48

a code review would be nice

@shash7
Copy link

shash7 commented Sep 13, 2014

I just checked the source code and it should be like :

var opts = {};
function Cookies(req, res, opts) {
    // Check if only opts is given
    if(arguments.length === 1) {
        opts = req;
        return false; // Don't know about this part
    } else {
    // Continue as usual
    }
}

@dougwilson dougwilson removed the 1.0.0 label Feb 29, 2016
@dougwilson dougwilson removed this from the 1.0.0 milestone Feb 29, 2016
@dougwilson dougwilson self-assigned this Feb 29, 2016
@dougwilson dougwilson mentioned this issue Feb 29, 2016
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants