Jump to content

cookie from outside of PrestaShop


kia

Recommended Posts

I need to use PrestaShop cookies in a page that is outside prestashop folder.

I try to use the code from

http://www.nethercottconstructions.com/en/content/53-prestashop-cookie-structure

to display cookies outside prestashop but when I load my page is directly transfert to the 404 error page, I use PrestaShop: 1.5.0.13, do you know how to fix it ?

thank you

Edited by kia (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Hi, im looking too, please come on anybody knows the way?

I tried including all possible files in my php file which I want to access the information from cookies, I have tried including all files below but not work:

include_once('path_to_prestashop/config/config.inc.php');
include_once('path_to_prestashop/config/settings.inc.php');
include_once('path_to_prestashop/classes/Cookie.php');
include_once('path_to_prestashop/admin/init.php');
$cookie = new Cookie('psAdmin');
if ($cookie->isLogged())
print 'Is logged';
else
print 'Is NOT logged';

 

Nothing work, only show lines error below:

Fatal error: Class 'Configuration' not found in /path_to_prestashop/admin/init.php on line 32

 

Fatal error: Class 'Cookie' not found in /path_to_prestashop/File_Im_Running.php on line 29

 

The problem seems to be PS_COOKIE_LIFETIME_BO but i am logged in the moment is executed, Some help :)

 

Best regards

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...