Forum Replies Created
-
AuthorPosts
-
Elliot, I’m a bit confused because in this forum you can’t directly reply to a certain post
A session will still be created unless your using this.
Who are you responding to?
Can you confirm that adding the above code snippet will break portfolio breadcrumbs and portfolio breadcrumbs only?
Also I am curious why the session is started even on a page that is not using portfolios at all. This seems to be a bug.
The sessions are used for the breadcrumbs so if you disable them then the portfolio breadcrumbs will not link back to the page where you used the portfolio grid shortcode on.
I don’t use the portfolio so that’s not a concern for me. I’m more interested in getting caching to work properly to make my site fast.
If i’m not using the portfolio shortcode, enfold shouldn’t be starting a session?
I have been experiencing the same issue with our company website. We are using varnish in front of wordpress, but it doesn’t cache page content because of the no-cache headers.
GiorgioAldeghi’s answer about changing php.ini settings for session.cache_limiter = public gave me a hint as to the cause. The no-cache headers are being added by PHP as a result of starting a PHP session, as I can see in my headers that there is also a session cookie being set when it shouldn’t be:
curl -I localhost
HTTP/1.1 200 OK ... Set-Cookie: PHPSESSID=j6pvq3vodd9nrl5a0tlkacvv86; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache ...
A session should definitely not be started for viewing normal page content when not logged in.
I did a grep search for session_start and found the culprits in avia related files:
$ grep -r -i –include \*.php session_start *
htdocs/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php: if(!is_admin() && !current_theme_supports(‘avia_no_session_support’) && !session_id()) session_start();
htdocs/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php: if(!is_admin() && !current_theme_supports(‘avia_no_session_support’) && !session_id()) session_start();As you can see, the avia-shortcodes are starting a session if we are not admin and the current theme does not support ‘avia_no_session_support’ and we don’t already have a session.
The solution for me was to add the following to my child theme functions.php:
function custom_theme_setup() { add_theme_support('avia_no_session_support'); } add_action( 'after_setup_theme', 'custom_theme_setup' );
But the real solution should be for Kreisi to fix this issue for the theme itself.
- This reply was modified 8 years, 11 months ago by Dingers90. Reason: it may have looked like i work for google
-
AuthorPosts