bikalabs/Bika-LIMS — pull request #1330 by veroc (2014-08-19 09:57:33+00:00)
Title: store referrer in cookie for page reload support.

document.referrer is lost if page is reloaded (timeout, error, ask customer ..) and user is trapped inside publish view because both submit and cancel buttons will stay on same url.
now the referrer is stored in a cookie so at least there is a chance for a valid back url. as fallback redirect to portal_url.