WordPress site will slow because of sessions in some cases


Yes some times WordPress will slow because of sessions

In some cases we have started session in functions.php and header.php.

When we place session_start() in header.php site will slow down at that time we need to use cookies like below

Set cookie 

<?php setcookie(“CookieData”, $value, time() + (86400 * 30), “/”);  ?>

Get cookie

<?php echo $_COOKIE[“CookieData”]; ?>

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s