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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:41:03+00:00 2026-06-08T22:41:03+00:00

I’m working in an ASP.NET (VB) Web Application with Windows/Active Directory Authentication I am

  • 0

I’m working in an ASP.NET (VB) Web Application with Windows/Active Directory Authentication

I am using a module so that I can call public subroutines and functions, and reference variables, without having to instantiate a new object to access them on each page.

Within that module, I have some Public variables that I am using in multiple pages throughout the web application. I’ve recently realized that the values for these public variables in the module get shared between all users.

THE GOAL:
I want the value for these global variables to be specific to a single user and not shared between all sessions, and I do not want to have to instantiate a new object/class on every page that uses the variable.

THE CATCH:
I don’t want to store the value in a client-side variable such as a cookie or session. I want the value to be stored on the SERVER but specific to each client/user.

The only thing I can think to do is setup a global collection/dictionary and store the variables with the authenticated user names, but then I need to have specific functions to get and set the values. While this will work, it requires all the references to these variables on all pages in the application to be updated.

EXAMPLE OF THE PROBLEM:
The below code shows how I am creating the public variable within the module and how the value is being set from one page and used on another. I’d like to continue to use this variable in the same way and share it’s value between pages, but the value of the variable needs to NOT be shared between users.

— MODULE.VB —

Public Module MyMod  
    Public myVariable as String = ""  
End Module  

— MAINPAGE.VB —

  Partial Class _Default  
        Sub Page_Load() Handles MyBase.Load()  
           myVariable = "HELLO WORLD"  
        End Sub  
    End Class  

— NEXTPAGE.VB —

  Partial Class _Default  
        Sub Page_Load() Handles MyBase.Load()  
           Response.Write(myVariable)  
        End Sub  
    End Class  

There are a LOT of pages in this application that will need to be manually updated if I have to use my userID-indexed collection solution, so I’m hoping there is a way to simply scope these variables differently or a way to disable the sharing between sessions.
Thanks in advance!

  • 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-08T22:41:05+00:00Added an answer on June 8, 2026 at 10:41 pm

    You didn’t indicate whether or not the variables need to be persisted across page round trips or whether they are just used within each page’s lifecycle.

    If they are not persisted across pages, then perhaps the easiest solution is to have all of your pages inherit from a based page class and then move the values from the module into the base page. This way you won’t have to change any variable references, only page inheritance.

    If you do want to persist the values, completing the above changes makes it much easier to implement. You can then turn the member variables on the base page into properties and embed your user specific caching and fetching in the getter and setter.

    For example, instead of:

    Public MyVariable As String = ""
    

    You would have something like:

    Public Property MyVariable As String
        Get 
           Return GlobalMyVariableCache(UserNameKey)
        End Get
        Set (Value As String)
           GlobalMyVariableCache(UserNameKey) = Value
        End Set
    End Property
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into

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.