I want to create a shopping cart with Meteor that allows non-logged in visitors to have persistent shopping carts.
As far as I can tell, the only way to track a non-logged in visitor in Meteor is to set a persistent ID on the client (localStorage) then pass that ID in every subscribe and method call.
Most web frameworks store a unique session ID in a cookie and that cookie is sent with every request to the server so the server always has a way to identify the visitor who sent the request - why not have similar functionality in Meteor?
It looks like Meteor persists the userId (if logged in) in localStorage and sends that userId to the server over the DDP connection - but that only helps when users are logged in. Why isn't this done with all visitors via a sessionId?
Am I missing something here? Other techniques are welcome - I just want to clean up my code and not have to pass the sessionId around everywhere.