Javascript – How to set and get cookies (server side) in Meteor


How can I set and get cookies (server side) in Meteor?

Best Solution

Meteor does not currently have a supported way to use cookies on the server.

You can use cookies on the client, though. Here's a snippet to show a splash screen the first time the user visits a page:

Meteor.startup(function () {
    if (!document.cookie.match("splash="))      
}); = {
    'click .submit': function () {      
        document.cookie = "splash=ack;expires=Sat, 23 Mar 2013 00:00:0 GMT";    

You could use a similar approach and set the cookies in client side code, then send the results to the server in a method call.