How to determine whether a session is running on worker process or not?
-
Hello, I have a web application hosted on local machine. Ex: http://localhost/xyz.aspx We have login page which prompts for user id and password. Once the user is validated, enters into another page. On all other pages, the user name gets displayed. Can we determine is there any session for the website is running or not? if we can find it, we want to stop multiple users from logging in from the same system. Please give me any ideas on this. Thank you, Raheem MA
-
Hello, I have a web application hosted on local machine. Ex: http://localhost/xyz.aspx We have login page which prompts for user id and password. Once the user is validated, enters into another page. On all other pages, the user name gets displayed. Can we determine is there any session for the website is running or not? if we can find it, we want to stop multiple users from logging in from the same system. Please give me any ideas on this. Thank you, Raheem MA
You're going about it wrong. Store a list of logged in users on the application level and check it when a user tries to log in. Add a time stamp for the last access, so you can time out users who didn't explicityl log out.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Hello, I have a web application hosted on local machine. Ex: http://localhost/xyz.aspx We have login page which prompts for user id and password. Once the user is validated, enters into another page. On all other pages, the user name gets displayed. Can we determine is there any session for the website is running or not? if we can find it, we want to stop multiple users from logging in from the same system. Please give me any ideas on this. Thank you, Raheem MA
Hi Raheem, You can try like this.... If you are validating user login against database then add one more field 'status' in ur table and update this field for successful login. In this way if another user tries to login then you can check status field , if it is not updated allow login otherwise inform that this login is already in use., And dont forget to update status field when user logs out. Note: you need to explicitly update status field in session_end event and in page unload events. Hope this helps you. Happy coding Regards Surender M
-
Hi Raheem, You can try like this.... If you are validating user login against database then add one more field 'status' in ur table and update this field for successful login. In this way if another user tries to login then you can check status field , if it is not updated allow login otherwise inform that this login is already in use., And dont forget to update status field when user logs out. Note: you need to explicitly update status field in session_end event and in page unload events. Hope this helps you. Happy coding Regards Surender M
333soori wrote:
Note: you need to explicitly update status field in session_end event and in page unload events.
EVen this cannot be trusted, he needs to add a timeout, and store the time of each page request, so he can tell that enough time has passed to regard the user as logged out
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
You're going about it wrong. Store a list of logged in users on the application level and check it when a user tries to log in. Add a time stamp for the last access, so you can time out users who didn't explicityl log out.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Thank you all for quick response, The website is already in production. The user name gets displayed on all the pages once the login successful. Suppose user A logged in and USER A is getting displayed on the next page. In another browser window user B logged in and USER B is getting displayed on the next page. Now, if you go th browser A, and do refresh the page, then USER B will be displayed on the page. this is the issue currently we have. How to overcome this? Please give me ideas :) Thank you, Raheem MA
-
Thank you all for quick response, The website is already in production. The user name gets displayed on all the pages once the login successful. Suppose user A logged in and USER A is getting displayed on the next page. In another browser window user B logged in and USER B is getting displayed on the next page. Now, if you go th browser A, and do refresh the page, then USER B will be displayed on the page. this is the issue currently we have. How to overcome this? Please give me ideas :) Thank you, Raheem MA
shah_tech wrote:
How to overcome this? Please give me ideas
You have been given two ideas. Obviously, if you've released the product, you are going to have to change it to overcome this bug.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.