I have to set a parameter at cookies when user comes with an specific subdomain, actually there's a cookie.js script in middleware like:
export default function ({ app, res, query }) {
let uri = window.location.href.split('?');
if (uri[1]) {
app.$cookies.set('pdv', query.pdv)
}}
I have to keep this feature, but when user comes from subdomain e.g: ask.exemple.com, automatically sets the PDV cookies as: 123.
E.g:
subdomain: ask / pdv: 123 subdomain: question / pdv: 456 ...
How can I do it?