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

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form