How does CakePHP use the 'hash' field/column in User?
I have a CakePHP 2.3 app with a MySQL database.
I'm building a new app (in a different language and framework).
The plan is to completely replace the CakePHP app with the new one. The code is almost ready, so I've just attempted to run it in production for the first time.
User login seems to have crashed in production because the field hash
in the users
table was changed to old_hash
. I did this because the new framework can't have fields with the name hash
.
Testing in development, this was not a problem at all.
In production it became a problem.
Development:
App in Vagrant VM and database in my machine's local MySQL
(MySQL 5.7)
Production:
App in AWS EC2 and database in AWS RDS
(MySQL 5.6)
Because all users
have the hash
column blank, I assumed it didn't matter.
The fact that it worked locally after changing it to old_hash
led me to worry even less about it.
I've searched for documentation on this specifically, but did not find anything detailed enough.
What does CakePHP use the hash
field/column in the users
table for?
Is there a place in the code where I can explicitly tell it to look for something named old_hash
instead?
What could be influencing the difference in behaviors between development and production?
Figuring all of this out would be awesome, because then my 2 apps would be able to briefly coexist in production, making the transition smoother.
authentication cakephp
add a comment |
I have a CakePHP 2.3 app with a MySQL database.
I'm building a new app (in a different language and framework).
The plan is to completely replace the CakePHP app with the new one. The code is almost ready, so I've just attempted to run it in production for the first time.
User login seems to have crashed in production because the field hash
in the users
table was changed to old_hash
. I did this because the new framework can't have fields with the name hash
.
Testing in development, this was not a problem at all.
In production it became a problem.
Development:
App in Vagrant VM and database in my machine's local MySQL
(MySQL 5.7)
Production:
App in AWS EC2 and database in AWS RDS
(MySQL 5.6)
Because all users
have the hash
column blank, I assumed it didn't matter.
The fact that it worked locally after changing it to old_hash
led me to worry even less about it.
I've searched for documentation on this specifically, but did not find anything detailed enough.
What does CakePHP use the hash
field/column in the users
table for?
Is there a place in the code where I can explicitly tell it to look for something named old_hash
instead?
What could be influencing the difference in behaviors between development and production?
Figuring all of this out would be awesome, because then my 2 apps would be able to briefly coexist in production, making the transition smoother.
authentication cakephp
There is no code in the CakePHP core that refers to a the specific column namedhash
, so it's probably something specific to your application that you need to look up in your codebase. The only thing that comes close is the namedigest_hash
that is used in the digest auth example code in the docs.
– ndm
Jan 2 at 10:53
You say "User login seems to have crashed because..." What makes you think it's because of this? If there's an error pointing to this, share those details.
– Greg Schmidt
Jan 2 at 17:21
So the error kept saying that it didn't find the users.hash field. After trying so many times and so many different things, my brain needed a reset, so I undid everything and started over. It worked fine. I'm wondering now if maybe I'd just not cleared cache well enough, or at the right time, the first time. Thank you for helping anyways! ndm's answer is what got me thinking I should restart.
– vivipoit
Jan 3 at 4:16
add a comment |
I have a CakePHP 2.3 app with a MySQL database.
I'm building a new app (in a different language and framework).
The plan is to completely replace the CakePHP app with the new one. The code is almost ready, so I've just attempted to run it in production for the first time.
User login seems to have crashed in production because the field hash
in the users
table was changed to old_hash
. I did this because the new framework can't have fields with the name hash
.
Testing in development, this was not a problem at all.
In production it became a problem.
Development:
App in Vagrant VM and database in my machine's local MySQL
(MySQL 5.7)
Production:
App in AWS EC2 and database in AWS RDS
(MySQL 5.6)
Because all users
have the hash
column blank, I assumed it didn't matter.
The fact that it worked locally after changing it to old_hash
led me to worry even less about it.
I've searched for documentation on this specifically, but did not find anything detailed enough.
What does CakePHP use the hash
field/column in the users
table for?
Is there a place in the code where I can explicitly tell it to look for something named old_hash
instead?
What could be influencing the difference in behaviors between development and production?
Figuring all of this out would be awesome, because then my 2 apps would be able to briefly coexist in production, making the transition smoother.
authentication cakephp
I have a CakePHP 2.3 app with a MySQL database.
I'm building a new app (in a different language and framework).
The plan is to completely replace the CakePHP app with the new one. The code is almost ready, so I've just attempted to run it in production for the first time.
User login seems to have crashed in production because the field hash
in the users
table was changed to old_hash
. I did this because the new framework can't have fields with the name hash
.
Testing in development, this was not a problem at all.
In production it became a problem.
Development:
App in Vagrant VM and database in my machine's local MySQL
(MySQL 5.7)
Production:
App in AWS EC2 and database in AWS RDS
(MySQL 5.6)
Because all users
have the hash
column blank, I assumed it didn't matter.
The fact that it worked locally after changing it to old_hash
led me to worry even less about it.
I've searched for documentation on this specifically, but did not find anything detailed enough.
What does CakePHP use the hash
field/column in the users
table for?
Is there a place in the code where I can explicitly tell it to look for something named old_hash
instead?
What could be influencing the difference in behaviors between development and production?
Figuring all of this out would be awesome, because then my 2 apps would be able to briefly coexist in production, making the transition smoother.
authentication cakephp
authentication cakephp
asked Jan 2 at 9:21
vivipoitvivipoit
476
476
There is no code in the CakePHP core that refers to a the specific column namedhash
, so it's probably something specific to your application that you need to look up in your codebase. The only thing that comes close is the namedigest_hash
that is used in the digest auth example code in the docs.
– ndm
Jan 2 at 10:53
You say "User login seems to have crashed because..." What makes you think it's because of this? If there's an error pointing to this, share those details.
– Greg Schmidt
Jan 2 at 17:21
So the error kept saying that it didn't find the users.hash field. After trying so many times and so many different things, my brain needed a reset, so I undid everything and started over. It worked fine. I'm wondering now if maybe I'd just not cleared cache well enough, or at the right time, the first time. Thank you for helping anyways! ndm's answer is what got me thinking I should restart.
– vivipoit
Jan 3 at 4:16
add a comment |
There is no code in the CakePHP core that refers to a the specific column namedhash
, so it's probably something specific to your application that you need to look up in your codebase. The only thing that comes close is the namedigest_hash
that is used in the digest auth example code in the docs.
– ndm
Jan 2 at 10:53
You say "User login seems to have crashed because..." What makes you think it's because of this? If there's an error pointing to this, share those details.
– Greg Schmidt
Jan 2 at 17:21
So the error kept saying that it didn't find the users.hash field. After trying so many times and so many different things, my brain needed a reset, so I undid everything and started over. It worked fine. I'm wondering now if maybe I'd just not cleared cache well enough, or at the right time, the first time. Thank you for helping anyways! ndm's answer is what got me thinking I should restart.
– vivipoit
Jan 3 at 4:16
There is no code in the CakePHP core that refers to a the specific column named
hash
, so it's probably something specific to your application that you need to look up in your codebase. The only thing that comes close is the name digest_hash
that is used in the digest auth example code in the docs.– ndm
Jan 2 at 10:53
There is no code in the CakePHP core that refers to a the specific column named
hash
, so it's probably something specific to your application that you need to look up in your codebase. The only thing that comes close is the name digest_hash
that is used in the digest auth example code in the docs.– ndm
Jan 2 at 10:53
You say "User login seems to have crashed because..." What makes you think it's because of this? If there's an error pointing to this, share those details.
– Greg Schmidt
Jan 2 at 17:21
You say "User login seems to have crashed because..." What makes you think it's because of this? If there's an error pointing to this, share those details.
– Greg Schmidt
Jan 2 at 17:21
So the error kept saying that it didn't find the users.hash field. After trying so many times and so many different things, my brain needed a reset, so I undid everything and started over. It worked fine. I'm wondering now if maybe I'd just not cleared cache well enough, or at the right time, the first time. Thank you for helping anyways! ndm's answer is what got me thinking I should restart.
– vivipoit
Jan 3 at 4:16
So the error kept saying that it didn't find the users.hash field. After trying so many times and so many different things, my brain needed a reset, so I undid everything and started over. It worked fine. I'm wondering now if maybe I'd just not cleared cache well enough, or at the right time, the first time. Thank you for helping anyways! ndm's answer is what got me thinking I should restart.
– vivipoit
Jan 3 at 4:16
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54003844%2fhow-does-cakephp-use-the-hash-field-column-in-user%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54003844%2fhow-does-cakephp-use-the-hash-field-column-in-user%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
There is no code in the CakePHP core that refers to a the specific column named
hash
, so it's probably something specific to your application that you need to look up in your codebase. The only thing that comes close is the namedigest_hash
that is used in the digest auth example code in the docs.– ndm
Jan 2 at 10:53
You say "User login seems to have crashed because..." What makes you think it's because of this? If there's an error pointing to this, share those details.
– Greg Schmidt
Jan 2 at 17:21
So the error kept saying that it didn't find the users.hash field. After trying so many times and so many different things, my brain needed a reset, so I undid everything and started over. It worked fine. I'm wondering now if maybe I'd just not cleared cache well enough, or at the right time, the first time. Thank you for helping anyways! ndm's answer is what got me thinking I should restart.
– vivipoit
Jan 3 at 4:16