Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9186509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:32:44+00:00 2026-06-17T19:32:44+00:00

I am writing a module for Magento that only allows users to login from

  • 0

I am writing a module for Magento that only allows users to login from specific IP addresses.

I am hooking into

 admin_session_user_login_success

and when my function runs, I am attempting to run

 Mage::getSingleton('admin/session')->logout();

however that function does not exist

 Invalid method Mage_Admin_Model_Session::logout

I read on

http://stackoverflow.com/questions/8455022/how-to-force-magento-to-logout

that the account controller or the session controller can also be used to log the user out but I am not sure how to logout an admin user.

Any snippets or ideas are greatly appreciated!

Thank you!

Jeff

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:32:46+00:00Added an answer on June 17, 2026 at 7:32 pm

    I was able to logout admin users with the following snippet

    $adminSession = Mage::getSingleton('admin/session');
    $adminSession->unsetAll();
    $adminSession->getCookie()->delete($adminSession->getSessionName());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing module which allows to quick add users only by providing First
I'm writing a kernel module that needs to read the value of bitrate from
I am writing a module that provides one function and needs an initialization step,
I am writing a module in OpenERP that would inherit from the Accounts module.
I am writing a module that should allow users to select parts of an
I'm writing a module in Drupal-7 that dynamically sends a one-time login link to
I am writing a module in Drupal 7, that shows some data from database
I am writing a module to deny admin users access unless coming from a
I'm writing a module that has multiple questions users can chose to answer. Each
I am writing a module for Drupal 7, that has 3 submodules. All submodules

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.