Conditional placement of content of a float


I would like to position content within a float, depending on whether the page number is odd or even


When the content "floats" to the next page from where it is in the source, the value of page is incorrect. Material that would appear at the bottom of page 6, appears on page 7, but \the\value{page}=6.

I've messed around with using \protect to delay the expansion of the conditional, and various other things, but nothing works. Does anyone have a solution?