News for hackers. Stuff that matters.
Re:Stealing passwords from McDonald's users by bluedino on Monday January 16, 2017 @08:43AM (#13409895)
>> Are there really "Teach yourself in 21 Days" books that have examples with this pattern that people are following?

Yes. From Learning PHP, MySQL, Javascript, CSS & HTML5, Third Edition, from O'Reilly publishing:

So, to create a cookie with the name username and the value Hannah that is accessible across the entire web server on the current domain, and will be removed from the browser’s cache in seven days, use the following:

    setcookie('username', 'Hannah', time() + 60 * 60 * 24 * , '/');
And that was published in 2014, not 2004.
Re:Stealing passwords from McDonald's users by bitexploder on Monday January 16, 2017 @09:05AM (#13410002)
A username is different from a password. There can often be legitimate or at least semi-legitimate reasons to do this.

I dunno everyone has to learn how to use cookies if they are building web apps.

Password is obviously just bad.

Re:Stealing passwords from McDonald's users by nommm-nommm on Monday January 16, 2017 @11:49AM (#13411063)
Everyone, really?

I've been building webapps since forever and I've never cookies directly in Javascript like that and I can't, personally, think of a use case where I would do that.

I've only used cookies that store a session id and I store everything in the session. The session id cookies are handled entirely by the servlet container.

I don't believe I'm doing it horribly wrong.

Re:Stealing passwords from McDonald's users by bitexploder on Tuesday January 17, 2017 @01:19AM (#13415567)
What you stated is pretty normal seeming to me, so no, not "everyone". But I think web developers still need to know what a cookie is and how to use it, even if you dont use them often. They can provide a better user experience remembering some aspects of a user or their session long after it has expired. Many sites have semi-authenticated states where you may not want to hold user data, but still remember some details about their session.