Magento 2 get Admin session in frontendCustomer Session outside MagentoNo Session Message on Frontend?Admin login problems. What are the correct settings of Session Cookie Management and Session Validation Management?Cookie/session problems on login frontend and adminMagento Admin Session IssueHow to get admin session(user) details on front side in Magento 2?Prolonging the admin sessionMagento 2.1 : Cannot retrieve session variableHow to get CategoryIds and Category name for selected Products in magento2 ?Magento get Customer Data from session id
Is it bad to describe a character long after their introduction?
Attempt to de-reference a null object: list initialization
What does grep -v "grep" mean and do?
Different budgets within roommate group
Why won't the ground take my seed?
What are good ways to spray paint a QR code on a footpath?
Can a single server be associated with multiple domains?
Automatically convert a number to use the correct SI unit prefix
Averting Real Women Don’t Wear Dresses
Why isn’t the tax system continuous rather than bracketed?
Does anyone know what these symbols mean?
Reverse of diffraction
Did Wakanda officially get the stuff out of Bucky's head?
If two black hole event horizons overlap (touch) can they ever separate again?
When are digital copies of Switch games made available to play?
Miss Toad and her frogs
Procedurally generate regions on island
How can my story take place on Earth without referring to our existing cities and countries?
Can a Federation colony become a member world?
Why don't all electrons contribute to total orbital angular momentum of an atom?
Can I travel from Germany to England alone as an unaccompanied minor?
Should I report a leak of confidential HR information?
What does Mildred mean by this line in Three Billboards Outside Ebbing, Missouri?
Meaning of もてり and use of が
Magento 2 get Admin session in frontend
Customer Session outside MagentoNo Session Message on Frontend?Admin login problems. What are the correct settings of Session Cookie Management and Session Validation Management?Cookie/session problems on login frontend and adminMagento Admin Session IssueHow to get admin session(user) details on front side in Magento 2?Prolonging the admin sessionMagento 2.1 : Cannot retrieve session variableHow to get CategoryIds and Category name for selected Products in magento2 ?Magento get Customer Data from session id
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
How can i get the admin session in frontend.
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$adminSession = $objectManager->create('MagentoSecurityModelAdminSessionsManager');
print_r($adminSession->getCurrentSession()->getStatus());
I tried with above script but no luck
magento-2.1 admin session
add a comment |
How can i get the admin session in frontend.
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$adminSession = $objectManager->create('MagentoSecurityModelAdminSessionsManager');
print_r($adminSession->getCurrentSession()->getStatus());
I tried with above script but no luck
magento-2.1 admin session
add a comment |
How can i get the admin session in frontend.
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$adminSession = $objectManager->create('MagentoSecurityModelAdminSessionsManager');
print_r($adminSession->getCurrentSession()->getStatus());
I tried with above script but no luck
magento-2.1 admin session
How can i get the admin session in frontend.
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$adminSession = $objectManager->create('MagentoSecurityModelAdminSessionsManager');
print_r($adminSession->getCurrentSession()->getStatus());
I tried with above script but no luck
magento-2.1 admin session
magento-2.1 admin session
asked Sep 28 '17 at 15:30
RameshRamesh
5025 silver badges25 bronze badges
5025 silver badges25 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
protected $_session;
public function __construct(
MagentoFrameworkModelContext $context,
MagentoBackendModelAuthSession $authSession
)
$this->_session = $authSession;
parent::__construct($context);
and then call
$this->_session->isLoggedIn()
Note: don't use objectManager
. Its not proper way to do it in Magento 2
no luck and MagentoFrameworkAppActionContext $context instead of MagentoFrameworkModelContext $context,
– Ramesh
Sep 28 '17 at 16:02
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f195158%2fmagento-2-get-admin-session-in-frontend%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
protected $_session;
public function __construct(
MagentoFrameworkModelContext $context,
MagentoBackendModelAuthSession $authSession
)
$this->_session = $authSession;
parent::__construct($context);
and then call
$this->_session->isLoggedIn()
Note: don't use objectManager
. Its not proper way to do it in Magento 2
no luck and MagentoFrameworkAppActionContext $context instead of MagentoFrameworkModelContext $context,
– Ramesh
Sep 28 '17 at 16:02
add a comment |
protected $_session;
public function __construct(
MagentoFrameworkModelContext $context,
MagentoBackendModelAuthSession $authSession
)
$this->_session = $authSession;
parent::__construct($context);
and then call
$this->_session->isLoggedIn()
Note: don't use objectManager
. Its not proper way to do it in Magento 2
no luck and MagentoFrameworkAppActionContext $context instead of MagentoFrameworkModelContext $context,
– Ramesh
Sep 28 '17 at 16:02
add a comment |
protected $_session;
public function __construct(
MagentoFrameworkModelContext $context,
MagentoBackendModelAuthSession $authSession
)
$this->_session = $authSession;
parent::__construct($context);
and then call
$this->_session->isLoggedIn()
Note: don't use objectManager
. Its not proper way to do it in Magento 2
protected $_session;
public function __construct(
MagentoFrameworkModelContext $context,
MagentoBackendModelAuthSession $authSession
)
$this->_session = $authSession;
parent::__construct($context);
and then call
$this->_session->isLoggedIn()
Note: don't use objectManager
. Its not proper way to do it in Magento 2
answered Sep 28 '17 at 15:54
Abhishek PanchalAbhishek Panchal
3,7303 gold badges9 silver badges29 bronze badges
3,7303 gold badges9 silver badges29 bronze badges
no luck and MagentoFrameworkAppActionContext $context instead of MagentoFrameworkModelContext $context,
– Ramesh
Sep 28 '17 at 16:02
add a comment |
no luck and MagentoFrameworkAppActionContext $context instead of MagentoFrameworkModelContext $context,
– Ramesh
Sep 28 '17 at 16:02
no luck and MagentoFrameworkAppActionContext $context instead of MagentoFrameworkModelContext $context,
– Ramesh
Sep 28 '17 at 16:02
no luck and MagentoFrameworkAppActionContext $context instead of MagentoFrameworkModelContext $context,
– Ramesh
Sep 28 '17 at 16:02
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f195158%2fmagento-2-get-admin-session-in-frontend%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown