I found the issue. In my navbar I have added this link:
<a href="$vboptions[bburl]/../photopost/search.php?when=2&whenterm=w&cat=all">Image Gallery</a>
If the user is on https, then for some reason the above link directs away from https to http. The system then sends the user back to http and effectively causing multiple searches.
Do you have any idea how I can make the above link work on both http as https?