Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Session Terminating Problem

Session Terminating Problem

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netdatabaseannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    naresh_pandey13
    wrote on last edited by
    #1

    Hello all , I m making an chat application using asp.net .I m using database for users.Mean when any one will chat he will log in and in database a field exist for all users named "LOGGED" .when any one will log in the value of this field will be yes and when he will log off the value of this field will be "NO" so I can avoid anyone to login fron more then one places mean if anyone has logged on he will not be able to log in from any other place or in another instance without log off. I did it but the problem is.... The session can be terminated using three ways .. 1. If the user press the LOGOFF button . 2. If any system error will occur and session terminate. 3. If any one will close the chat window using browser's close button. If anyone will press the log off button no prob ,I can terminate the session and update the database .But if any one use the method 2 and 3 for closing how i can update the database .I did one thing if any one will close the browser using cross button ,I have used the body unload event and that time i just terminate the session and In global.asax in SESSION_ONEnd event I have wriiten aquery for update .But it is not working .. Please if any one have solution for method 2 and 3 send me . Thanks This is Jitendra

    A 1 Reply Last reply
    0
    • N naresh_pandey13

      Hello all , I m making an chat application using asp.net .I m using database for users.Mean when any one will chat he will log in and in database a field exist for all users named "LOGGED" .when any one will log in the value of this field will be yes and when he will log off the value of this field will be "NO" so I can avoid anyone to login fron more then one places mean if anyone has logged on he will not be able to log in from any other place or in another instance without log off. I did it but the problem is.... The session can be terminated using three ways .. 1. If the user press the LOGOFF button . 2. If any system error will occur and session terminate. 3. If any one will close the chat window using browser's close button. If anyone will press the log off button no prob ,I can terminate the session and update the database .But if any one use the method 2 and 3 for closing how i can update the database .I did one thing if any one will close the browser using cross button ,I have used the body unload event and that time i just terminate the session and In global.asax in SESSION_ONEnd event I have wriiten aquery for update .But it is not working .. Please if any one have solution for method 2 and 3 send me . Thanks This is Jitendra

      A Offline
      A Offline
      Aryadip
      wrote on last edited by
      #2

      hi, As you are making a chat application so I expect that you have implemented it as a client-server application. You can achieve what you are asking in the following way... whenever client logs in to your server the server should assign client a unique token and should keep track of client's idle time (like yahoo does). If the client's idle time exceeds the maximum allowed idle time your server should automatically update the database with logged field as NO. In other words your server should be responsible for tracking wheather you are logged in or out. If server logs the user out and the browser is still there then if a request comes, the server should notify the client that the user has been logged off and needs to relogin... In this way the client application need not bother about logging itself off. All it will do is : it will request the server and server will do the job. Hope this tip helps you... regards, Aryadip. Cheers !! and have a Funky day !!

      N 1 Reply Last reply
      0
      • A Aryadip

        hi, As you are making a chat application so I expect that you have implemented it as a client-server application. You can achieve what you are asking in the following way... whenever client logs in to your server the server should assign client a unique token and should keep track of client's idle time (like yahoo does). If the client's idle time exceeds the maximum allowed idle time your server should automatically update the database with logged field as NO. In other words your server should be responsible for tracking wheather you are logged in or out. If server logs the user out and the browser is still there then if a request comes, the server should notify the client that the user has been logged off and needs to relogin... In this way the client application need not bother about logging itself off. All it will do is : it will request the server and server will do the job. Hope this tip helps you... regards, Aryadip. Cheers !! and have a Funky day !!

        N Offline
        N Offline
        naresh_pandey13
        wrote on last edited by
        #3

        Thanks AryaD I m trying to implement it Thanks Again Have a Nice future This is Jitendra

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups