Forum
Session cookie for both HTTP and HTTPS
How can I make Perch keep me logged in on both HTTP (local) and HTTPS (remote)?
Can I just edit /perch/core/lib/PerchSession.class.php to change $http_only to false?
My situation is that I have both my local development version and my live production version on the same domain, and I'm using a Proxy Auto-Configuration (.pac) file to have Firefox switch between them based on the protocol.
That file is simple and looks like this:
function FindProxyForURL(url, host) {
if (dnsDomainIs(host, "mysite.com") && !shExpMatch(url, "https*"))
return "PROXY 127.0.0.1:80";
}
Works fine, except I can't be logged in to both sites at the same time. Logging into one logs me out of the other.
I have decided to switch to a different server name for local development.
I changed it to mysite.dev. Also had to disable Firefox's HSTS preload list with network.stricttransportsecurity.preloadlist=false More info: https://tutoref.com/how-to-prevent-firefox-and-chrome-from-forcing-dev-and-foo-domains-to-use-https/