News for hackers. Stuff that matters.
Re:Living Without Sessions by njharman on Monday October 06, 2008 @07:50PM (#325462)
What if you need state for users without username and password?

For instance let them add things to their cart and only require registraton/login once they buy.

What if you want more than one basket?

What if baskets are shared among users.

Replace "basket" with "state" for above.

How is http://example.org/shop/users/johndoe/basket different/better than http://example.org/shop/users/johndoe/?sessionkey=123456 or http://example.org/shop/baskets/123456/

"differ from storing the cart in a user session" I never store anything but sessions in user sessions, carts go in the cart table/whatever. Carts may have a session_id they are associated with, but they are probably keyed to user instead(depends). Probably stored in a cookie(state on the client).

Not saying author is wrong, I just don't get it.

And how come rest folks don't end their resources with a '/'. like http://example.com/users/bob/ The "root" resource ends in a slash. http://example.com/ Having that be inconsistent with other resources always bugs me. I tend to have verbs not end in slash. http://example.com/users/bob/delete Very consistent and orderly to my obcom mind.

There are no comments on this comment yet.