navigate to a work https://archiveofourown.org/works/21911809
scroll to skin chooser in the footer
switch to Reversi
Be redirected to Reversi's Skins page at https://archiveofourown.org/skins/929
replicate 2-5 with LVD, Snow Blue - redirect to skin's particular /skins/###
replicate 2-5 with Default - get redirected to site's top level.
Step 5 should be redirect back to the referer, or if we can't do that because we don't have the referer, redirect to the home page. https://github.com/otwcode/otwarchive/blob/6e02a48c36e3167f74fbb68d142fee80c0d77b93/app/controllers/skins_controller.rb#L120-L128
The reason that redirect_back_or_default doesn’t work here is because there’s no skip_before_action :store_location in the skins controller. That means that any calls to redirect_back_or_default will redirect back to the current URL (which is the one most recently stored with store_location), instead of to the referrer.
This means that the #set and #unset actions are actually visited twice any time you use the skin chooser. The first time stores its own path in session[:return_to], then redirects “back” to that same path and sets session[:return_to] = "redirected". The second time sees that it was redirected from the value of session[:return_to], so it clears session[:return_to] in store_location instead of setting it, resulting in redirect_back_or_default falling back on the default.