albertkao 12 Junior Poster in Training

To ensure my program keep the client preference after page refresh, do I do this:

var value = Cookie.get('key'); 
if (value == null) { 
    // get  the client preference 
    // ... 
    // save  the client preference 
    Cookie.set('key', 'uservalue'); 
} 

// use the client preference
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.