How sessions numbers are assigned

Alexis Demont 21 Reputation points
2022-11-24T15:32:24.583+00:00

Hello,

I'm currently learning how windows works.

To quickly sumarize my question, i understood that most services are running under the session 0 and that the first user session should be session 1. However when i look on my computer i can see that my session is for exemple the session 15 or another number. Why it's not session 1 ? Is it for security purposes ?

Thanks you in advance,

Alexis Demont

Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 49,536 Reputation points
    2022-11-25T18:52:27.527+00:00

    I checked my session ID on my computer, and for now it's 17, yesterday it was 15. I would like to understand what decides the session ID ?

    Is your system configured to use Fast Startup?

    My Windows 10 system doesn't use Fast Startup and every time the system cold boots or restarts the initial interactive session id is 1. If I logoff and then log back on the session id is 2. Every time a logon/logoff occurs the session id is incremented.

    I asked about Fast Startup because I suspect that is the cause of the high session numbers that you are seeing. What happens if you do a system restart instead of shutting down. I believe a system restart may result in your interactive session id being set to 1 when you log back on.

    1 person found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-11-25T20:00:29.25+00:00

    Most likely every time you logoff and back on. It's just a simpler process to increment session Ids rather than spend processing time to recycle them.

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    2 people found this answer helpful.

  2. Anonymous
    2022-11-24T15:55:30.41+00:00

    Read on here, there's a bit more to it than sessions alone.
    https://brianbondy.com/blog/100/understanding-windows-at-a-deeper-level-sessions-window-stations-and-desktops

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    0 comments No comments

  3. Alexis Demont 21 Reputation points
    2022-11-24T16:30:49.66+00:00

    Hello,

    Thanks you for your answer the link seems to be really interesting.

    I will read it and close the question if I find my answer in it :D


  4. Alexis Demont 21 Reputation points
    2022-11-25T17:25:50.913+00:00

    Ok so this article was really interesting and I learned a lot of things. Thank you for sharing it with me.

    I'm just a little confused by this part "As far as NT services go, each NT service that has credentials specified will create its own Window Station and Desktop." Why some processes are creating desktops for themselves ? I understood the concept of station and session, I think I need to learn better how desktops works.

    To go back to my initial question, i couldn't find my answer. I checked my session ID on my computer, and for now it's 17, yesterday it was 15. I would like to understand what decides the session ID ? Is this like randomize ?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.