Wordpress phpinfo cookies issue

admin

Administrator
Staff member
Hey ya'll I have this site here <a href="http://www.taranmarlowjewelry.com/" rel="nofollow">http://www.taranmarlowjewelry.com/</a> and in the top right corner there is a shopping cart, but it does not show up when you first visit the site, but when you refresh the page it shows up.

I have been looking into this and I think it has to do with this cookie PHPSESSID because when I delete that cookie the shopping cart goes away again.

I have also been told this is a PHP configurations issues.

I tried making some adjustments to my php5.ini file like so...

Code:
session.use_only_cookies = 1
session.use_trans_sid = 0

session.url_rewriter.tags = ""

but that didnt work....I got it from here <a href="http://wordpress.org/support/topic/frontpage-slideshow-and-phpsessid-in-general-fix?replies=1" rel="nofollow">http://wordpress.org/support/topic/frontpage-slideshow-and-phpsessid-in-general-fix?replies=1</a>

Does anyone know which I need to adjust in my php configuration?

I tried to set a cookie in wp-content/themes/twentyeleven/header.php right after the tag like this...



Code:
&lt;?php
setcookie("PHPSESSID","6a52e6037be6342014834c475b6c0637","/","http://www.taranmarlowjewelry.com/") 
?&gt;

and then I get this error...

Code:
Warning: setcookie() expects parameter 3 to be long, string given in /home/content/19/9468119/html/wp-content/themes/twentyeleven/header.php on line 54

and the shopping cart does not show up when you first visit my site but when you refresh it will still show up.

I even manually put in the cookie in my theme's functions.php file at the bottom like so...

Code:
function set_new_cookie() {
    setcookie("PHPSESSID", '6a52e6037be6342014834c475b6c0637', time()+3600);  /* expire in 1 hour */

}
add_action( 'init', 'set_new_cookie');

it sets it, it doesn't show any errors, but it does not solve my problem.

I also tried this in my theme's functions.php file...

Code:
 function set_new_cookie() {

    set_cookie('PHPSESSID', '6a52e6037be6342014834c475b6c0637');
    $_COOKIE['PHPSESSID'] = '6a52e6037be6342014834c475b6c0637';


}
add_action( 'init', 'set_new_cookie');

and got this error

Code:
Fatal error: Call to undefined function set_cookie() in /home/content/19/9468119/html/wp-content/themes/twentyeleven/functions.php on line 5

here is the shopping cart form...

Code:
&lt;form class="product_search" style="font-size:0px !important;" method="GET" action="&lt;?php echo $pp_url?&gt;/" &gt;
                &lt;input name="product_search" id="wpsc_search_autocomplete" class="wpsc_product_search wpsc_live_search_embed .wpsc_live_search" autocomplete="off" style="padding:0px !important; height:25px !important; vertical-align:top;" /&gt;
                &lt;script type='text/javascript' &gt; /* &lt;![CDATA[ */
                    jQuery('#wpsc_search_autocomplete').keypress( function(e){
                        if ( e.keyCode == 13 ) {
                            var url = '&lt;?php echo $pp_url ?&gt;'+'?product_search='+jQuery(this).val();
                            url = encodeURI(url);
                            jQuery(window.location).attr('href', url);
                        }
                    });
                     /* ]]&gt; */
                     &lt;/script&gt;
                     &lt;input type="submit" id="button" name="button" class="searchBtn" value="GO"/&gt;
            &lt;/form&gt;