I am trying to overwrite _mtko_trk cookie and it is updating fine without page reload .But the issue is , in visitwebpage Activity , cookie that is passing is the previous one.
What's wrong that I have done ?
Well, first, it's _mkto_trk, not _mtko_trk.
But we couldn't know what you're doing wrong without having a look at your code.
I have 2 instances based on user type but in prelogin I have set one cookie on 1 instance.
Once user is logged in, based on user type cookie is updated with instance 2.
So the issue is , when visitwebpage triggers, the request payload has instance 1 cookie.
_mchRu: some value
_mchTk: instance1 cookie token
_mchPo: some value
_mchPc: some value
_mchVr: some value
So why these values are not updating as per new cookie ?
One more question here, when does these values gets initiated ?
Again, I need to see the code you're attempting to use to do this. You haven't provided enough information.
This is the piece of code, which is invoking to create cookie.
That's clearly not all your code, since it's calling multiple userland functions that aren't defined here.
Also don't understand what you're trying to do with the max-age; you shouldn't be passing a stringified Date to max-age, which officially accepts only a Number. (There's a distracting typo in munckinID, too.)
Overall, although I don't have the code you're really running, the timing seems wrong. What is the actual business purpose of manually recreating the cookie? Why aren't you letting Munchkin recreate the cookie after you delete it? What is the bigger picture here?
I am trying to create a new cookie on single page application. Based on different user type, I have to create different cookies.
And invoking the above shared function for updating the cookie.
The main concern here is , once the new cookie is set and then trigger visitwebpage activity , on this visitwebpage the params are passing but the cookie is previous one not the updated one.
I tried to create new cookie by munchkin code , but in single page application, cookie is not creating until we reload the page.
The use case I want is create different cookie based on user and track their activities on different instances.