0

I am just new in magento. I have installed magento on my localhost. After installing I have tried to login as admin, But I can't be able to login. I have tried in different browsers, But all browsers are redirecting to the login page itself. I have tried the solution given in this question. But it was producing error.

Please any one help me to solve this issue.

Community
  • 1
  • 1
James
  • 2,874
  • 4
  • 30
  • 55

4 Answers4

0

I'm writing this answer to help those who are facing the same problem.

A quick solution I have found for this issue is worked great form me.

I have created a virtual host in my system. And reinstalled the Magento. After completion of installation, when I tried to login everything is working fine.

I think this was the best solution for this problem, rather than editing the Magento core.

To create virtual host on windows, Linux or mac visit here

James
  • 2,874
  • 4
  • 30
  • 55
0

Do not edit any files. First, verify your Cookie Domain is correct in your Magento Configuration in

System > Configuration > Web

This should match the URL you are using to access the local store.

Otherwise here is an alternate method which also supports multiple local stores. In this suggestion you will be

1: adding a local domain in your local hosts file

2: updating your Apache configuration (if using MAMP/XAMMP)

3: setting this domain in your Magento Configuration Base URL and Cookie Domain.

This method uses the new local domain as the URL (http://local.domain.com/) and it consistant resolved any domain / login issues i've had.

Mac:

Open terminal (COMMAND + Spacebar, then type "terminal" and hit enter) Type

sudo nano /etc/hosts 

Add the following line to the bottom of your hosts file. Press CTRL+V to move to the bottom of the page, and add the following:

127.0.0.1        local.domain.com

Windows:

instructions here

Update your Apache configuration to add a VHOST directive as per instructions in my other answer here

Community
  • 1
  • 1
LAMAGENTO
  • 86
  • 3
0

If making changes in the varien file didn't work than this may be the problem of the cookie.The below mentioned method works for me and hope will also work for you.

Check the values for cookies in magento database. In phpmyadmin I found table core_config_data, then fields with values : web/cookie/cookie_domain and web/cookie/cookie_path. They were both blank.

My solution was to set:

web/cookie/cookie_domain to my domain name

and

web/cookie/cookie_path to /.

Example:

your domain where you run magento is magento.local set:

web/cookie/cookie_path = magento.local

and

web/cookie/cookie_path = /

Hope this will help.

Navin Bista
  • 1,988
  • 2
  • 21
  • 37
0

I'm on Ubuntu 14.04 and after try almost everything, it has worked for me:

1 - Set the right timezone on php.ini and restart the server

2 - Install Magento via comand line using the right params of configuration

php -f install.php -- \
--license_agreement_accepted "yes" \
--locale "LOCALE" \
--timezone "TIMEZONE" \ 
--OTHERPARAMS

3- Set the Locale of your system too

sudo locale-gen your_LOCALE.utf8
export LC_ALL="YOUR_LOCALE.utf8"
export LC_CTYPE="YOUR_LOCALE.utf8"

Ps.: Don't use localhost as your server domain, a virtual host is better.

Be happy!

Wellington Lorindo
  • 2,405
  • 19
  • 21