Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Admin Cookies questions


dave111

Recommended Posts

Posted

I'm trying to have some text show if cookies are/or are not enabled in the admin area.

 

Example: If cookies are enabled in browser it says "you have cookies" or not then it says "you dont have cookies"

 

I've tried all the following:

 

<?php if ($use_cookies) { echo 'something something'; } ?>

<?php if ($send_cookies) { echo 'something something'; } ?>

<?php if ($sessions->use_cookies) { echo 'something something'; } ?>

 

Any ideas, i know its bound to be something simple like using the wrong variables.

Posted

Hi Dave, there is some code in application_top that checks the HTTP_COOKIE_VARS array So I just used it for the example below:

 

	if (isset($HTTP_COOKIE_VARS['cookie_test'])) {
   echo 'cookies on';
} else {
   echo 'cookies off';
}

Posted

ok, couple of things you would have to copy the part of the code from the catalog side that sets the cookie_test over the admin. Or you could simply set it over the admin side by calling the setcookie function (like the code below). Then you check with the $HTTP_COOKIE_VARS array if the specific cookie is set. If do the test in a function set the $HTTP_COOKIE_VARS array as global for manipulation.

 

setcookie('cookie_test', 'please_accept_cookie', time()+3600);  /* expire in 1 hour */

Posted

I got it to work with this:

 

<?php  
if ($_COOKIE) {
echo 'cookies on';
} else {
echo 'cookies off';
} ?>

  • 3 weeks later...
Posted

Hi guys,

 

EU laws require me to tell customers how/why cookies are used on my OSCsite so I'm wondering

is there any specific reason cookie_test is valid for 30 days ? And what is to purpose of cookie_test ?

If I turn cookie_test to expire "at the end of session" does it harm/brake some features of the OSC ?

 

"The cookie set is titled cookie_test and will exist on the clients computer for 30 days."

See: chapter: Force Cookie Usage

http://www.oscommerce.info/kb/osCommerce/D...plementations/4

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...