using "Session" in Windows Application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ahmed Yasser
    New Member
    • Feb 2007
    • 12

    using "Session" in Windows Application

    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.
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by Ahmed Yasser
    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

    Comment

    • Ahmed Yasser
      New Member
      • Feb 2007
      • 12

      #3
      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=willakawi ll]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]

      Comment

      • willakawill
        Top Contributor
        • Oct 2006
        • 1646

        #4
        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?

        Comment

        • Ahmed Yasser
          New Member
          • Feb 2007
          • 12

          #5
          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.







          Originally posted by willakawill
          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?

          Comment

          • ansumansahu
            New Member
            • Mar 2007
            • 149

            #6
            Originally posted by Ahmed Yasser
            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

            Comment

            Working...