0

In lightning experience, when adding query parameters and reloading the page, they seem to be cleansed from the page on reload, however, fragment identifiers (or hashes) are persistent.

Ex:

https://sub-domain.lightning.force.com/lightning/n/app

If I add a query parameter:

https://sub-domain.lightning.force.com/lightning/n/app?query=potato

and reload the page, the params are cleared after the page reload.

However, if I add a hash:

https://sub-domain.lightning.force.com/lightning/n/app#query=potato

the hash is persists after a page reload...

Is there any reason why query parameters are removed when I reload my page vs hashes ?

1

The query string is sent to the server, so technically it shouldn't be used in a Lightning App, or indeed any Single Page Application (but some types of apps do use this technique via the History API, which lets you "fake" navigating between URLs). The hash string is only ever used by the client, and this is how Lightning remembers the current state of the app. There's no particular reason why it's cleared out that I know of, other than that's how it's designed to behave.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.