I have successfully installed magento 2.0 However I cannot see any default theme appled on the front end and also I am not able to login to my admin panel
Magento2 Login – Cannot Access Magento 2.0 Admin Panel
loginmagento-2.0magento2
Related Solutions
Looks like your source, pretty much lifted my original SO Answer.
With that said be sure and make sure the secretKey
info is being set and other session methods are defined and dispatching any events or else it won't work.
<?php
require_once 'app/Mage.php';
umask(0);
$app = Mage::app('default');
Mage::getSingleton('core/session', array('name' => 'adminhtml'));
// supply username
$user = Mage::getModel('admin/user')->loadByUsername('adminusername');
if (Mage::getSingleton('adminhtml/url')->useSecretKey()) {
Mage::getSingleton('adminhtml/url')->renewSecretUrls();
}
$session = Mage::getSingleton('admin/session');
$session->setIsFirstVisit(true);
$session->setUser($user);
$session->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());
Mage::dispatchEvent('admin_session_user_login_success',array('user'=>$user));
if ($session->isLoggedIn()) {
echo("logged in");
}
Source:
I think that you have an issue with cookies
If the URL or domain of the site has changed in the migration, check the "Cookie Domain" setting in System >Config. You find it under General > Web > Session Cookie Management
and it's called "Cookie Domain".
If this parameter doesn't match your site's actual domain name, what happens is that the login form is submitted, the user is logged in and a session cookie issues. The user's browser is then redirected to the protected page, but the cookie is not sent with the new request, so Magento believes the user has not yet logged in.
The main symptom to look for if it's a cookie domain
issue is as follows:
The user submits the login form and when the form is displayed again there's no message indicating the user failed to log in. However, if they enter an incorrect username or password the message does appear.
Generally cookie domain can be left blank and the site works as expected.
Best Answer
Please enable the rewrite_module from apache module and clear the cache. Hope it will solve your problem