00sapo Posted August 24, 2015 Share Posted August 24, 2015 (edited) Hi, I have to create a new custom page for login. It is an external page which makes a post to a php script in my module which checks password and email and if they are correct it redirect to the homepage. Instead the login doesn0t happen and the homepage is served as a gueast. I have checked email and password, so I know everything about the customer. This is the code, where is the error? Thanks $context = Context::getContext(); $customer = new CustomerCore(); if (isset($_REQUEST['email']) && isset($_REQUEST['pass'])) { if (ValidateCore::isEmail($_REQUEST['email']) && ValidateCore::isPasswd($_REQUEST['pass'])) { if ($customer->getByEmail($_REQUEST['email'], $_REQUEST['pass'])) { $customer->logged = true; $context->customer = $customer; $cookie = $context->cookie; $cookie->id_customer = $customer->id; $cookie->customer_lastname = $customer->lastname; $cookie->customer_firstname = $customer->firstname; $cookie->logged = true; $cookie->email = $customer->email; } } } Edited August 24, 2015 by 00sapo (see edit history) Link to comment Share on other sites More sharing options...
00sapo Posted August 25, 2015 Author Share Posted August 25, 2015 No answer at all? No suggestions at all? Link to comment Share on other sites More sharing options...
vekia Posted August 25, 2015 Share Posted August 25, 2015 try to save cookie $this->context->cookie->write(); Link to comment Share on other sites More sharing options...
00sapo Posted September 26, 2015 Author Share Posted September 26, 2015 try to save cookie $this->context->cookie->write(); Thank you very much, this worked! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now