Answer the question
In order to leave comments, you need to log in
gulp. Why is session data lost when building javascript?
Hello, I'm having a problem understanding how gulp and node.js work. Can you please explain why I am losing session data?
I run gulp watch (or just gulp js).
I'm editing some javascript.
I save (task 'js' is running)
I reload the page and see that the session is gone...?
This does not happen when building css or images.
Link to weight gulpfile.js https://gist.github.com/batazor/15bb05856f298da122fe
And specifically task js
gulp.task('js', function() {
return gulp.src(watch.js)
.pipe(concat('index.js'))
.on('error', console.log)
.pipe(uglify())
.pipe(gulp.dest(public.js))
.pipe(notify({ message: 'JS task complete' }));
});
Answer the question
In order to leave comments, you need to log in
For the changes to JS to take effect, you need to restart the Node.js process. If your sessions are not stored in external storage (memcached, redis, mongo) and not in cookies, but in the process memory, then they will naturally die upon restart. Which is most likely what is happening in your case.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question