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

  • SEARCH
  • Home
  • 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 6979489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:53:37+00:00 2026-05-27T17:53:37+00:00

I am writhing a simple online game , in a specific time , every

  • 0

I am writhing a simple online game ,
in a specific time , every day , the game will be updated and when the time comes , first I need to log out users.
In “Application_Start” function in Global.asax , I initialize the timer and when it ticks , the method “UpdateGame” , which I wrote it in Global.asax is called. here is the method:

    public static void UpdateGame()
    {

        AccountController account = new AccountController();
        AdminController admin = new AdminController();
        HomeController home = new HomeController();

        account.LogOff();
        admin.ChechHireEndTimes();
        admin.CheckRentsEndTimes();
        admin.UpdateRankings();
        admin.InitializeAbstractTimes();
    }

when it came to the logOff() , it freezes. here is the logOff method:

    [Authorize]
    public ActionResult LogOff()
    {

            FormsService.SignOut();
            return RedirectToAction("Index", "Home");            
    }

I worked a lot on it but it seems that because the logout is not called with a http request , it is not working as when the user press the logout button.

so my question is that how can I invoke a controller’s action like this one , from inside Global.asax?

  • 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-05-27T17:53:38+00:00Added an answer on May 27, 2026 at 5:53 pm

    You cannot do log off action in global.asax without a user context. Which user should be logged off when you do account.LogOff()? I believe that redirection (RedirectToAction) with app_start is probably freezing your app.

    For logging out all users, you may use a LastUpdated global flag (set by UpdateGame method to current time). While logging in, you can put the LastUpdated value into user session and in each request, check this value with the global value. If global value is higher then you have log-out the current user by invoking your log off method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a simple proxy (more a packet logger) for an online game in
I'm writing a simple proxy (more a packet logger) for an online game in
I'm interested in putting together my first online game using Flash as the client
I'm writing a simple online multiplayer game. It involves sending a few http requests
I am writing a simple checkers game in Java. When I mouse over the
I'm currently writing a simple .sh script to parse an Exim log file for
Is there a jquery shell/parser emulation online where i can input simple jquery commands
I'm writing some simple point code while trying out Visual Studio 10 (Beta 2),
I've tried several methods of keeping a log of my day-to-day activity when writing
I'm writing an app to view an online web text-based game. I want to

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.