I am trying to cater for a user using their browser back button to access a page which contains multiple drop down lists (some are shown on selection of others using jQuery). When the user makes a room selection, advances to the next page, returns using the browser back button and makes a different selection I am resetting the drop-down lists on page load. When the user then advances again using Chrome and IE I get the following correct array structure:
Array
(
[15] => Array
(
[12] => Array
(
[num_rooms] => 0
[price] => 39.5
)
[15] => Array
(
[num_rooms] => 1
[adults] => Array
(
[0] => 2
)
[prices] => Array
(
[0] => 49.5
)
[roomTotalPrice] => Array
(
[0] => 49.5
)
[price] => 99
)
[14] => Array
(
[num_rooms] => 0
[price] => 49
)
[16] => Array
(
[num_rooms] => 0
[price] => 39.5
)
[13] => Array
(
[num_rooms] => 0
[price] => 39.5
)
)
This is correctly showing number of ‘adults’ for the selected room/rate combo, room 15 and rate 15.
When I run the exact same code in Firefox the array is getting corrupted in the following manner:
Array
(
[15] => Array
(
[12] => Array
(
[num_rooms] => 0
[price] => 39.5
)
[15] => Array
(
[num_rooms] => 1
[price] => 99
)
[79] => Array
(
[adults] => Array
(
[0] => 2
)
[prices] => Array
(
[0] => 49.5
)
[roomTotalPrice] => Array
(
[0] => 49.5
)
)
)
Rather than adding the ‘adult’ data to room/rate 15 it is getting added to a non existent rate ’79’.
Any advice as to why Firefox might be doing this?
Adding the following code to the page prevented Firefox from caching the data and resolved the issue: