Authored by biao

update for set cookie

const model = require('../models');
const Cookies = require( "cookies" );
exports.index = (req, res) => {
const channelType = req.path.substring(1) || 'men';
model.getContent(channelType).then(result => {
const cookies = new Cookies(req, res);
cookies.set('_Channel', channelType);
res.display('index', Object.assign({
module: 'channel',
page: 'home',
... ...
... ... @@ -37,6 +37,7 @@
"connect-memcached": "^0.2.0",
"connect-multiparty": "^2.0.0",
"cookie-parser": "^1.4.3",
"cookies": "^0.6.1",
"express": "^4.13.1",
"express-handlebars": "^3.0.0",
"express-session": "^1.13.0",
... ...
... ... @@ -6,8 +6,6 @@
var lazyLoad = require('yoho-jquery-lazyload');
var homePage = $('.home-page').data('page');
require('../common/header');
require('../common/return-top');
require('../plugins/slider');
... ... @@ -27,11 +25,3 @@ $('.card').mouseenter(function() {
$this.addClass('active');
});
if ($.inArray(homePage, ['men', 'women', 'lifestyle']) > -1) {
window.setCookie('_Channel', homePage, {
domain: '.yohoblk.com',
path: '/',
expires: 365
});
}
... ...