localhost to 127.0.0.1 as default - magento

I am trying to use Magento on a localhost, but when I try and log in to the admin area the screen just refreshes.
In the address bar it was localhost/magento/.......(etc). When I changed it to 127.0.0.1/magento/.......(etc) it allowed me in. When I click on one of the buttons in the admin area it goes back to localhost/magento/......(etc) and I am once again faced with the login page.
How and where do I alter the setting the settings so the 127.0.0.1 is used as default rather than localhost.

Finally after seven hours of playing about with suggestions and re-installing I have fixed it, for those with the same problem i will share what I did.
I am using Magento 1.7.0.2. Apparently there is an issue regarding cookies when you install Magento on windows as it was designed for linux system. So you need to sort the cookie issue. To do this open your Magento folder and go to app>code>core>mage>core>model>session>abstract varien.php at lines 85-92:
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()
//'domain' => $cookie->getConfigDomain(),
//'secure' => $cookie->isSecure(),
//'httponly' => $cookie->getHttponly()
);
change the code to this.
Apparently there are other issues such as php curl, I did not come across these but the following tut:
http://ecommercedeveloper.com/articles/1419-tutorial-avoid-two-problems-installing-magento-on-a-localhost/
covers it. Also that's where I got the information from, however the code in the version I'm using is slightly different from that version.

If you want to change loaclhost to 12.0.0.1 do following.
If you have database access go to "*core_config_data*" table and there change "web/unsecure/base_url" and "web/secure/base_url" to 127.0.0.1 instead of localhost.
Otherwise you can use the solution provided by tony09uk.

on OS X I found a simpler way - I am using MAMP running 127.0.0.1:8888, the default for MAMP installs.
Just set your /app/etc/config.xml line that says localhost to 127.0.0.1
delete var cache and session contents
clear cookies in browser
this now lets me login to the dashboard from the admin login screen.

If you have database acces open table: core_config_data
Do a search for: SELECT * FROM core_config_data WHERE path LIKE '%cookie%'
change: cookie_domain & cookie_path to = ""
(empty string).
Login once again to the admin panel. fixed!

Related

XAMPP Invalid authentication method set in configuration: ‘cookie’

I have read all the possible fixes for the above issue when trying to get XAMPP working. Nothing has worked and I need to find an answer to get it working for a college course.
I am running a Mac OS X 10.11.6 and downloaded the XAMPP version 5.6.40. Then I open http://localhost/phpmyadmin/ go to user accounts and change the root password on for local host.
Then I go to the file config.inc.php and change 'config' to 'cookie' and also change the password. Then I restart the servers try to log back in but it gives the above error message and doesn't let me enter credentials. Some students in my class have done it the exact same way and it has worked for them.
I have looked at and tried many possible fixes as I can but with no success.
If you are using
$cfg['Servers'][$i]['auth_type'] = 'cookie';
Then you can set the user and password to blank, as using cookie makes phpMyAdmin throw a login page where you are expected to enter the userid and password in the login dialog.
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
It would also be worth refreshing your browser cache after making this change.
Thats CRTL+F5
Dont forget to restart Apache after making this change

Sentry on Laravel 4 with MAMP

I'm using Laravel on MAMP PRO (PHP 5.4). Both are vanilla install and I got Laravel working okay.
Next, Installed Sentry.
Inside of a login function on controller:
$user = Sentry::authenticate($credentials, false); // this works. I can see the $user
But then upon an immediate redirect I use a filter:
Route::filter('auth.admin', function()
{
var_dump(Sentry::check()); // ** this gives me a bool(false);
die();
if ( ! Sentry::check())
{
return Redirect::route('admin.login');
}
});
So, I'm assuming that maybe there is a cookie that is not being set?
Solved...
For anyone else with this issue, this is a summary of the most common solutions on the Internet as well as how I solved my issue. I'm on MAMP/OSX, but this apparently made zero difference as I literally put up a vagrant/virtualbox and still had the same issue.
** Set 'domain' => 'yourdomain.com' in your config/session.php. EVEN IF YOU ARE ON A SUB DOMAIN like a.b.c.yourdomain.com, use ONLY the root domain (yourdomain.com) in your 'domain' variable as I just wrote it. ** This was my issue.
Make sure your session storage folder has write permissions.
Make sure you have a >0 lifetime in your session.php
Make sure you don't have whitespaces after any closing PHP which could cause the application not to shut down properly.
Try Switching between database sessions and file sessions.
As a last resort, try upgrade to 4.2, if possible. 4.1 had a known issue (as referenced in google).
Your issue is may no be with Laravel OR Sentry. It's probably a file or configuration issue as illustrated above. I pulled my hair out tracking this from Sentry to Laravel to Cookies to Session to Blah... Only to realize that it was finally a cookie issue which was caused by me not setting my ROOT domain (I was using the full

Can't login into magento 1.8.1.0 on localhost on wamp server using correct username and password

I have fresh installed magento 1.8.1.0 on localhost with wamp server. Everything has been installed correctly but when i login into the login page with correct username and password it opens the same login page and not get into dashboard page.
I had read a lot of threads saying to make changes in variens.php by opening Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.
When i open app/code/core/ i can't find mage folder in core folder.
Please help how can i fix it?
thank you
kamaldeep singh
I don't have the folder mage inside the app/code/core. But i read some thread and made changes using 127.0.0.1/mymagento/index.php/admin in address bar by editing my C:/Windows/system32/drivers/etc/hosts it went to dashboard page
And appears error on dashboard
Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\wamp\www\mymagento\lib\internal\Magento\Framework\Code\Reader\ClassReader.php on line 77
i checked classReader.php on line 77 but there is no line related to nesting level to edit.
When i refresh the dashboard page it opens the login page. when i try to login with correct username and password it opens the same login page and no error like invalid username or password.
If you don't have the Mage folder inside app/code/core your website should not work at all. That folder is essential to run Magento. Check again.
About your problem, do you get any error (wrong username, password, etc.)?
Do you mean a customer cant login, or you cant log into the backend, there is an existing issue with customer login depending on the version of magento you might be using.
find : app/design/frontend/(themepackage(/(theme)/template/customer/form/login.phtml
under
<ul class=”form-list”>
paste in
<input type=”hidden” name=”form_key” value=”<? echo Mage::getSingleton(‘core/session’)->getFormKey(); ?>” />
And in app/design/frontend/(themepackage(/(theme)/template/persistent/customer/form/login.phtml
Apply the same changes.
Clear cache.
Customers should then be able to login.
Resource
Does it says that username or password is wrong or only refreshes the page without any error messages? If there are no errors then try to delete cookies for your host and then login again. Usually it helps.
Are you using chrome? If so, try Firefox. Another option might be to use 127.0.0.1/... instead of localhost/...
In your magento installed folder, go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php And comment out the lines 96 to 112 in v1.9. Lines may differ due to version. Look for lines that looks like this below:
// session cookie params
/** $cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}
**/
Have fun :)
If you have this problem on non FireFox browser(s), use FireFox to execute this action below and try login in with your non FireFox browser(s) again to confirm. I had this issue with Chrome.
Go to System > Configuration > Web > Session Cookie Management. And change Use HTTP Only from YES to NO.

Cakephp randomly drops session

Recently I moved my cakephp site from a hosting service to an other. The page was working like a charm, but now I'm having the issue, that my sessions randomly drop.
I'm on a shared hosting service, so I changed cake's session defaults from php to cake, now my sessions are saved to my tmp/sessions folder. (but it wasn't working with php either)
Followed my session's way with Firebug:
When i log into the page, i have a Sessionid, and in the tmp/sessions folder i have the corresponding sess_{sessionid} file too.
After a few clicks on some pages (totally random) my sessionid changes and i'm "logged out".
The session file with which i've logged in, remained in the directory.
My session settings in core.php right now:
Configure::write('Session', array(
'defaults' => 'cake'
));
I'm using the 2.3.8 version of Cake.
Update:
Finally i found the problem thanks to Nick. I checked the Cakephp error files, and found out that i only got logged out, when i visited a page containing an element, which was not on the server ( eg a picture was missing). So i went to Firebug, and check what the Net tab says. On the new Host service i got a 404 Not Found response AND a new session id set in the response, whilst on the other servers i tested the page, i simply got a 404 Not Found. If i randomly generate links to not existing files like (domain/test.jpg) i get the same results.
Try these settings, in Firefox you can install the web develop extension, then you can view your cookie to see if it is all set correct.
Configure::write('Session', array(
'defaults' => 'php',
'cookie' => 'yourdomain',
'timeout' => 44640,
));
Check any components that you are using for whitespace (usually at the end of the file).
I came across this recently whilst helping a client with their existing CakePHP site, when logged in one particular page that called a component was killing $this->Session->read(‘Auth’).
There is a CakePHP shell that you can use to find whitespace.

Joomla displaying blank page after login after moving the installation from one server to another

I just moved my current office Joomla 1.5.8 instalation from the server(linux) to my local machines (winxp) so I can work locally and only upload the changes.
The thing is after downloading all the files and installing a backup of the remote DB on my local machine I found myself unable to login to the administrator panel, I can see the frontpage but not login :/
So far, I have googled alot this problem, but most people seem to be experiencing this problem while upgrading from joomla 1.0
To make sure the problem was not on permissions for the files,I did a separate brand new joomla instalation on another folder and it worked just fine, I could access the website and I also could login to admin page, then I changed the config file to connect to the joomla I'm trying to move and now I find myself again unable to login :/
I think the problem is on the DB however I already tried searching for specific paths but no luck
Does anyone has another Idea?
thanks in advance :)
Try to change following variable in your local configuration file with you local values.
var $offline = '0';
var $log_path = 'Your local joomla path\logs';
var $tmp_path = 'Your local joomla path\tmp';
var $live_site = 'local url will be here';
var $dbtype = 'mysql';
var $host = 'local db host';
var $user = 'DB user for local';
var $db = 'Db name for local';
var $dbprefix = 'DB prefix whatever you have set, by default jos_';
var $password = 'your DB password for local';
You probably have LDAP or openid authentication enabled and thats what is causing this blank page while you try to login.
Just go to your database and go to your:
jos_plugins
And edit the plugins which are either openid or LDAP
set their published status from 1 to '0'
Case solved.
Does your site use any kind of extra authentication? Mine used the LDAP Authentication plugin. MY local machine couldn't connect to the LDAP server. After turning LDAP authentication off (only use Joomla authentication) it worked.
edit the jos_plugins table in mysql to set published from 1 to 0 for any extra authentication plugins you are using.
I have discussed this issue in details here: http://www.itoctopus.com/blank-page-on-joomla-login
In most cases we have seen, Joomla is trying to load a file that no longer exists.

Resources