en Jump to content
  • 0
Sign in to follow this  
Global Attribute AB

[SOLVED] How to generate Cookie Key?



I've been so stupid I deleted my settings.ini.php file by misstake.

I've tried to setup a new one but I don't know how to generate a cookie key.

This is my settings.ini.php:


define(’PS_BASE_URI‘, ‘/’);
define(’THEME_NAME‘, ‘Silver’);
define(’DB_NAME‘, ‘dbname’);
define(’DB_SERVER‘, ‘dbserver’);
define(’DB_USER‘, ‘dbuser’);
define(’DB_PREFIX‘, ‘ps_’);
define(’DB_PASSWD‘, ‘dbpassword’);
define(’DB_TYPE‘, ‘MySQL’);
define(’COOKIE_KEY‘, ‘???????’);
define(’COOKIE_IV‘, ‘cookie_iv’);
define(’PS_VERSION‘, ’’);


I really need some fast help.

The website is: www.attribute.se (for now it's blank).

Thanks in advance!

Share this post

Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

It's the following code on lines 48-49 of install/xml/createDB.php that creates the cookie key and IV:

array('_COOKIE_KEY_', Tools::passwdGen(56)),
array('_COOKIE_IV_', Tools::passwdGen(8)),

It just generates a random 56-letter key for the cookie key and a 8-letter IV both made up of uppercase and lowercase letters and numbers. You could easily create them yourself, but note that changing these values will cause all your existing passwords to stop working, so you will need to recreate your password using the new cookie key. See here for how to do that.

Share this post

Link to post
Share on other sites
  • 0

Just for my knowledge,


does that apply to rijndael key too and also customers will loose all password if such keys are lost?


Last doubt, if somone get the keys can get to my passwords?

If so I should copy them in a safe place.



Share this post

Link to post
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
Sign in to follow this  


Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More