Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Intro to Java Web Development with Spark Diving into Web Development Me Want Cookie

Charles Harpke
Charles Harpke
33,986 Points

You can access a cookie by name using the method on the Request object named

This should be clearly discernable in the video, but I am finding this not to be the case.....

Charles Harpke
Charles Harpke
33,986 Points

request.cookie("foo"); // access request cookie by name

Nope.....doesn't fit in the response....

1 Answer

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Hi Charles Harpke !

Here's the Spark documentation on Cookies. Does that help? Is the cookie just not showing up?

Let me know if you are still having problems, and we'll get you sorted out!

Charles Harpke
Charles Harpke
33,986 Points

Well....wondering if the quiz question expects some verbiage I'm not getting.... I can see the Spark documentations says: request.cookie("foo"); // access request cookie by name the quiz question doesn't accept any variation on that.

Without giving me the answer.....am I on the right track anyway? lol

Aaron Campbell
Aaron Campbell
16,267 Points

Craig Dennis

Like he mentioned, the problem is that the answer is not taking any form of the syntax. We know what the answer is. The quiz isn't taking it.

Craig Dennis
Craig Dennis
Treehouse Teacher

The method name is cookie. Does that work for you? I just tested and it does for me.

Aaron Campbell
Aaron Campbell
16,267 Points

Yes, that worked for me!

It was confusing, because we figured you wanted the whole method, like cookie() or request.cookie() or whatever. So simple, and here we are, making it complicated. XD

Thanks, Craig!