Bug Report: wixLocation.to() Clears Session

I’m working with Wix code and had a button that executes some code then switches page. Unfortunately… I’m realizing that there appears to be a bug which causes the function wixLocation.to() to clear the session before switching pages. Can this be fixed?

Might be able to find a work around (if I execute code, then use a normal link… does that code execute first?) but definitely an issue as I need to later be able to access variables stored in the session.

Unexpected and undocumented behavior at a minimum but seems to me that at least if staying within the same website, it should not clear the session.

Thanks!

Update: turns out this only clear the session if I try to use
wixLocation.to(wixLocation.baseUrl + ‘/earn-frinks’);

If I instead use: wixLocation.to(‘/earn-frinks’); then it doesn’t clear the session.

Still a bug but at least an easy work around in case anyone else encounters this.