0

I have installed Magento2.4 on my local windows IIS server. I have gone through different hurdles from css, js not loading to few other. Resolved all issues step by step. One Major issue is session. Unable to login even though site loads well.

Have created local domain and the site is loading on http://magento.toys/. Physical files are in C:\inetpub\wwwroot\toys and IIS configuration is made to load this magento instance on the local domain by setting vhosts/

var\session file permission to IIS user is set and it is writable. Evidently various sess_5i76o1din7jrn60rbn7kgbbtvb files are created successfully.

When I check form_key and PHPSESSID in the page source, the form_key is different than the _form_key present in the session path stored in the PHPSESSID. So, when submitting the form inside \vendor\magento\framework\Data\Form\FormKey\Validator.php I print form_key from submitted form and PHPSESSID _form_key as below

 echo '<pre>'; print_r($formKey); echo '</pre>';
 echo '<pre>'; print_r($this->_session->getSessionId()); echo '</pre>';
 echo '<pre>'; print_r($this->_formKey->getFormKey()); echo '</pre>';
 die; 

It proved that key from form and session are not matching. Hence, login on frontend / backend are not working.

To verify once again, updated the form_key from PHPSESSID on form inspect and tested the registration. Surprisingly, it worked well.

core_config_date entried as below

web/unsecure/base_url = http://magento.toys/
web/secure/base_url = http://magento.toys/
web/cookie/cookie_domain = magento.toys
web/cookie/cookie_secure = 1

Is there a work around to fix the issue on IIS?

asked Jul 8 at 9:28

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.