简体   繁体   中英

Security salt issues with CakePHP

I had some form validation issues which I created this thread . Someone suggested starting with a fresh installation of Cake, so I decided to replace the lib folder with a fresh copy and keep my app folder.

I renamed the original lib folder to lib1 rather than deleting it and dragged in a fresh copy of the lib folder. Upon trying to open my app I got the message to change the security salt. Please change the value of 'Security.salt' in APP/Config/core.php to a salt value specific to your application. [CORE/Cake/Utility/Debugger.php, line 849]

I changed the salt value and it went away, but then when I tried to login to an account on my application, it says invalid password. I changed the salt back to the original version and put back the original lib folder and I could once again log in.

Is there any way that I can get this to work, or will I have to start with an entirely fresh copy and transfer all of my current models, views, js files, etc..? If the salt is located in the app folder and that's the only location you have to modify it upon initial installation, what is it about the lib folder that it recognizes the salt is incorrect?

You will need to create users using the new salt .

You aren't supposed to use the default salt.

If you have access to database you can change your password by concatenating your SALT value from core with your plain desired password and do SHA1 of this string.

Ex:

Salt = 9Fv2a6h392t8ST4L46850151C156PeR7
Pass = test 

Encrypted database password:

sha1(9Fv2a6h392t8ST4L46850151C156PeR7test) = 3ef431e19c03c3d9878ecb8a743a706d54e6662c

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM