web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How session ID in AX 2012 is generated

(1) ShareShare
ReportReport
Posted on by 202

Hi Experts,

I'm a Junior Developer of Dynamics AX 2012 R3.

I have some question about how session id is generated in AX 2012.

what I know is, the number that generated in the session id is increment-based, and always increments whenever the user logged in. and the increment behavior is always incrementing and not using session id that has been used even tough that session id is not used by any user or process.

Is my opinion correct? can you give me the right explanation about it?

Thanks,
Chaidir Ali Assegaf

*This post is locked for comments

I have the same question (0)
  • Sukrut Parab Profile Picture
    71,710 Moderator on at

    Check below link , see if it helps

    dynamicsuser.net/.../session-id-generation

  • Chaidir Ali Assegaf Profile Picture
    202 on at

    Hi Sukrut,

    Thanks for your answer, I appreciate it.
    But, after I read the thread, I find that the thread doesn't answer my question.

    Here's some additional information :
    I have already checked the CREATEUSERSESSIONS Stored Procedure, and see how it works.
    the code is looking for the biggest value of session ID with max(SessionID) + 1

    SELECT @max_val = MAX(SESSIONID) + 1
    FROM SYSCLIENTSESSIONS WITH (UPDLOCK)

    after it retrieves the biggest value of session ID, the next process is inserting that value with another parameter needed into SYSCLIENTSESSION Table.

    INSERT INTO SYSCLIENTSESSIONS (SESSIONID, SERVERID, VERSION, LOGINDATETIME, USERID, SID, USERLANGUAGE, HELPLANGUAGE, CLIENTTYPE, SESSIONTYPE, RECID, CLIENTCOMPUTER, STATUS, DATAPARTITION) VALUES (@max_val, @serverid, @versionid, @loginDateTime, @userid, @sid, @lanExt, @manExt, @clientType, @sessionType, @recid, @computerName, 1, @dataPartition)

    the code seems working if you see it at a glimpse.

    I decided to test it with a user, creating many sessions with it, and see if the number is incrementing like the code is written.

    the test result is :
    UserSession.png

    if You see at the result, the session ID is not increasing by the time when the user logged in, it's more like the number was generated randomly.

    that's about it.

    Thanks,
    Chaidir Ali Assegaf

  • Chaidir Ali Assegaf Profile Picture
    202 on at

    Deleted post

  • Blue Wang Profile Picture
    on at

    Hi Chaidir,

    Some Web servers generate session IDs by simply incrementing  numbers.

    However, most servers use algorithms that involve more complex methods.

  • Verified answer
    guk1964 Profile Picture
    10,888 on at

    The Ax server uses a connection pool where connections are given to a session on an on-demand basis from a cache. So,  you might not see an SPID for a particular session at that instant when that session is not executing a SQL statement.

    CREATESERVERSESSIONS stored procedure  is invoked during the startup of an AOS server and it  populates the SysServerSessions table..

    CREATEUSERSESSIONS stored procedureis invoked each time a client is launched and populates the SysClientSessions table.

    Session types include: User, Worker, Web User, Business connector, impersonated session

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans