In Search of a Fair Fare

Can someone answer this important question, please? You know how you will search for a plane ticket online and find one at a price that is somewhat reasonable, and then call your mom to make sure the arrival time works with her schedule? And, lo and behold, she’d rather you take the red eye (moms!), but you check and one does not exist. So, the first flight you found will be fine, she guesses. When you go back to your computer to book it, the “session has expired” — or whatever it says that means you have to re-do your search. Once again, you enter the airports and dates, hit “search,” and THE PRICE HAS DOUBLED! Five minutes later! It is no coincidence or bad luck, because this happens every time. Here is the question: is that legal? Is it legal to advertise the same service at a two different prices within a matter of minutes? And how is the doubled fare not evidence of price gouging?

Follow-up question: How? How do they do it, exactly? Something-something IP addresses?