Password protected galleries won't load after password submitted
When managing client photo galleries in Sunshine Photo Cart, a common issue that arises is gallery passwords not working as expected. This can be particularly problematic when you or your clients try to access a password-protected gallery. You enter the password, but instead of granting access to the gallery, the page just reloads and prompts for the password again. The root cause of this frustrating loop is typically related to caching.
Caching is used to speed up website loading times by storing static versions of pages. However, this becomes a problem with dynamic pages that require real-time updates or interactions, such as entering a password to access a client photo gallery. What happens here is that your caching system is serving the password-protected, cached version of the page, which doesn't recognize the newly entered password.
This caching can occur at two levels:
- Server-Level Caching: This is provided by your web host. It's integrated at a deeper level and can be more challenging to configure or disable for specific pages.
- Caching Plugins in WordPress: These are more common and user-configurable. Most caching plugins for WordPress come with options to exclude certain pages or cookies from being cached.
The fix
Sunshine sets a cookie named sunshine3_session the moment someone enters a gallery password. Tell your cache to skip the cache whenever that cookie is present.
That single rule fixes this without giving up any speed. A visitor arriving at the gallery for the first time still gets the fast cached copy, and the moment they enter a password they get a fresh page that recognizes it. There are step by step details, including what to do if your cache can only exclude by URL, in getting caching to work with Sunshine Photo Cart.
Still need help?
If you have not yet found your answer in the documentation articles, please contact support