Hai provato a passare il SID nella query string o tramite POST quando ti sposti da HTTP ad HTTPS e viceversa?