Is there a way to have something similar to a web session in c#?
For example if I set a integer somewhere integer id = 5; Could I access that integer at a later time in a different class?
I am writing an app that communicates with a web service and I need to keep the id of the authenticated user around for queries to the web.
Or is my best option to use a database and store the id and access it from the database when needed.
available where?- in the language itself. Astatic classwithpublic staticproperties is probably what @paqogomez meant. I would definitely recommend against that, given your skill level and the debugging nightmare "global variables" like that can introduce. You should invest your time in learning more about OO design and structure.staticclass that holds that for you but global state is considered an anti-patten for a reason. What makes you not want to pass it around as an argument?