By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,805 Members | 1,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,805 IT Pros & Developers. It's quick & easy.

using "Session" in Windows Application

P: 12
Hi Everybody,

I would like to ask, is it possible to create a "session" in the windows applications. I know it is an imporatant tool for the web developers, but i need a similar tool to control the users login to a windows application.

Any reply Please
Thanks in advance.
Mar 19 '07 #1
Share this Question
Share on Google+
5 Replies


100+
P: 1,646
Hi Everybody,

I would like to ask, is it possible to create a "session" in the windows applications. I know it is an imporatant tool for the web developers, but i need a similar tool to control the users login to a windows application.

Any reply Please
Thanks in advance.
Session is only required in a web application because web pages are stateless. This is not the case with windows apps. You can store any information you like in global variables. You could even name one 'session' if you like
Mar 19 '07 #2

P: 12
Thanks for your reply, but let me describe my problem in more details. I have a login form in a win application that asks for a user name and a password, which i check versus a table that contains the users information. Once the user is logged in, i need a mechanism to prevent another login with the same username
from a different PC, to solve this, once a user is logged in, i change the login_state from N to Y(Login_state is a field in the users table) and check it at every other login. The problem is, if the program or windows crashes before retreiving the login_state to N again at logout, it keeps thinking that the user is still logged in and prevent anyother logs with this username.


Any helping ideas .....



QUOTE=willakawill]Session is only required in a web application because web pages are stateless. This is not the case with windows apps. You can store any information you like in global variables. You could even name one 'session' if you like[/quote]
Mar 19 '07 #3

100+
P: 1,646
Even a session variable cannot prevent this. You do this by using tight security. The login details are the responsibility of the person using them.

What are you using the login details for?
Mar 19 '07 #4

P: 12
I am using the login details to make sure that the number of connected users to my program over the network and to the Oracle database server doesnot exceed 10 at any time and also to prevent duplication in login usernames at the same instance to prevent data conflict. That is why i update the users table in the database with every new log in or out as described. The idea looks good except for the bug in case of program crashs.







Even a session variable cannot prevent this. You do this by using tight security. The login details are the responsibility of the person using them.

What are you using the login details for?
Mar 20 '07 #5

100+
P: 149
Hi Everybody,

I would like to ask, is it possible to create a "session" in the windows applications. I know it is an imporatant tool for the web developers, but i need a similar tool to control the users login to a windows application.

Any reply Please
Thanks in advance.
First of all session are part of web applications only. So you cannot have them in win applications. Yes you cannot handle the login issue if your application crashes in between.The state will show as logged in. One way can be to store the Login details in a table and at specific intervals from the Oracle database run a job schedule to check if a specific login in beyond a certain time limit. For this we will have to look for an Then we can reset that state from the backend.
The only thing is that you will have to decide the max time limit for a particular valid login to exist. It it 4 hours , 5 hours or 6 hours.

thanks
ansuman sahu
Mar 20 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.