In my Node.js app I initialize session every time new client accesses the app by typical
app.use(express.session({ secret: config.secret.session, store: new RedisStore()));
which is inside app.configure
.
Now what can I do if I do not want to filter traffic from bots and not create sessions if I detect that user-agent belongs to a bot by passing user-agent through a regex e.g.
/bot|index|spider|crawl|wget|slurp|Mediapartners-Google/i
But where do I put this condition?