Allow only one current session per user

alyssas
Member Posts: 28
Hello,
My client would like to implement code to only allow a user to login to Navision once (one current session at a time.) I've reviewed posts related to this topic, but they mostly seem to deal with being able to kill an additional session. I want to add code to the login form/table to check the Database information sessions table to see if the user is already logged in. However, I can't figure out where the source code is for the current sessions or what objec to add the logic to kick off the check when the user logs in. Any help would be appreciated!
Thanks!
Alyssa
My client would like to implement code to only allow a user to login to Navision once (one current session at a time.) I've reviewed posts related to this topic, but they mostly seem to deal with being able to kill an additional session. I want to add code to the login form/table to check the Database information sessions table to see if the user is already logged in. However, I can't figure out where the source code is for the current sessions or what objec to add the logic to kick off the check when the user logs in. Any help would be appreciated!
Thanks!
Alyssa
0
Comments
-
alyssas wrote:Hello,
My client would like to implement code to only allow a user to login to Navision once (one current session at a time.) I've reviewed posts related to this topic, but they mostly seem to deal with being able to kill an additional session. I want to add code to the login form/table to check the Database information sessions table to see if the user is already logged in. However, I can't figure out where the source code is for the current sessions or what objec to add the logic to kick off the check when the user logs in. Any help would be appreciated!
Thanks!
Alyssa
You should put your code call in CoduUnit 1 - ApplicationManagement in triger/function CompanyOpen Or LogInStart.
In your code you can check sesions with help of system table 2000000009 - Sesion.
bostjan0 -
I don't see table Session (2000000009) - I'm using a 3.10B database. How do I gain access to it if it isn't in the object designer?
Thanks!
Alyssa0 -
It's a virtual table. That means this table is not visible in the object designer, but it can be used as a subtype for record variables.
Create a C/AL global variable recSession, with DataType Record and Subtype Session. When you press the lookup on Subtype, you'll see all virtual tables.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Great - thanks for all your help! Was able to successfully code today...0
-
bostjanl wrote:alyssas wrote:Hello,
My client would like to implement code to only allow a user to login to Navision once (one current session at a time.) I've reviewed posts related to this topic, but they mostly seem to deal with being able to kill an additional session. I want to add code to the login form/table to check the Database information sessions table to see if the user is already logged in. However, I can't figure out where the source code is for the current sessions or what objec to add the logic to kick off the check when the user logs in. Any help would be appreciated!
Thanks!
Alyssa
You should put your code call in CoduUnit 1 - ApplicationManagement in triger/function CompanyOpen Or LogInStart.
In your code you can check sesions with help of system table 2000000009 - Sesion.
bostjan
Hello,
I'm interested by this solution but when Navision carries out these functions, the session already exists.
Is it possible to check current sessions before the creation of a new session?
If not, do you request with the user to disconnect itself or is it possible to disconnect it automatically?
Thank you by advance for your answers
Jeff0 -
Jeff wrote:bostjanl wrote:alyssas wrote:Hello,
My client would like to implement code to only allow a user to login to Navision once (one current session at a time.) I've reviewed posts related to this topic, but they mostly seem to deal with being able to kill an additional session. I want to add code to the login form/table to check the Database information sessions table to see if the user is already logged in. However, I can't figure out where the source code is for the current sessions or what objec to add the logic to kick off the check when the user logs in. Any help would be appreciated!
Thanks!
Alyssa
You should put your code call in CoduUnit 1 - ApplicationManagement in triger/function CompanyOpen Or LogInStart.
In your code you can check sesions with help of system table 2000000009 - Sesion.
bostjan
Hello,
I'm interested by this solution but when Navision carries out these functions, the session already exists.
Is it possible to check current sessions before the creation of a new session?
If not, do you request with the user to disconnect itself or is it possible to disconnect it automatically?
Thank you by advance for your answers
Jeff
Hi!
We just do ERROR msg and that it. I didn't look for automatic disconect.
Bostjan0 -
For what reason do you want this functionality?"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Hi can someone please tell me what code i would need to put in to CoduUnit 1 - ApplicationManagement in triger/function CompanyOpen Or LogInStart to make this work?0
-
Hi, you should modify the code unit 40 (LogInManagement)0
-
Session Record TableID=2000000009
Session.SETRANGE("User ID",USERID);
Session.SETRANGE("My Session",FALSE);
IF Session.FIND('-') THEN
......
Then You can use MESSAGE (Warning) or ERROR (user can not open navision data)
but in any case there session record will be in navision in case that is no possible to delete entries in table Session. (This is possible starting Navision version 4)
@pavithrap0992 : in Navision Attain there is no codeunit 40 (LogInManagement)! Please read thread category.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions