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;








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










share|improve this question




























    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










    share|improve this question
























      0












      0








      0


      1






      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










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 28 '17 at 15:30









      RameshRamesh

      5025 silver badges25 bronze badges




      5025 silver badges25 bronze badges




















          1 Answer
          1






          active

          oldest

          votes


















          0














          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






          share|improve this answer























          • no luck and MagentoFrameworkAppActionContext $context instead of MagentoFrameworkModelContext $context,

            – Ramesh
            Sep 28 '17 at 16:02













          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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






          share|improve this answer























          • no luck and MagentoFrameworkAppActionContext $context instead of MagentoFrameworkModelContext $context,

            – Ramesh
            Sep 28 '17 at 16:02















          0














          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






          share|improve this answer























          • no luck and MagentoFrameworkAppActionContext $context instead of MagentoFrameworkModelContext $context,

            – Ramesh
            Sep 28 '17 at 16:02













          0












          0








          0







          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






          share|improve this answer













          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







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?