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 7638731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:14:40+00:00 2026-05-31T08:14:40+00:00

I need to have access to the logged in user troughout a flash application.

  • 0

I need to have access to the logged in user troughout a flash application. Therefor I’m concidering making the ‘user’ variable global.

I usually try to avoid global variables, but it seems quite suitable in this case and I’m not the first to concider the active user as a global. I know that systems like drupal also uses a global variable for the logged in user.

I want to know if stackoverflow thinks of this as bad practice or if there are better alternatives.

  • 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-31T08:14:42+00:00Added an answer on May 31, 2026 at 8:14 am

    If you use a global variable, you are creating a dependency on that variable in all the modules that use it. So, for example, if you wanted to reuse any of those modules in another project, you would need to take their use of this global variable into account.

    Having said that, I don’t particularly find it bad design to have a global variable for a user-id. If you wanted to reuse any of the modules that use it, you would want to deal with users anyways, and will probably have that global variable in your new application too.

    There are dependency-injection frameworks that could solve this for you. Whether they will add value to your specific project or not depends on many other considerations, and it is really up to you.

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

Sidebar

Related Questions

We have a need to access kernel global vars in net/ipv4/af_inet.c that are not
I have a web application that will need to access code behind methods as
I have a need to use extensionless URLs. I do not have access to
I'm writing an app, and in many situations need to have direct access to
I need to run a script and have access to the default stdin (terminal
I have an access database, with a query made. I need to automate it
I have a SQL query (MS Access) and I need to add two columns,
I have two C DLLs that I need to access in the same executable.
I have two different modules that need access to a single file (One will
I have common functionality that I need to access from all screens of my

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.