session destroy with onunload event brower

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oranoos3000
    New Member
    • Jan 2009
    • 107

    session destroy with onunload event brower

    hi
    i'd like to destroy sessions for logging out logged in user
    with onuload event from brower

    i wrote a script that with onunload event brower a function is ran that is writen with jquery and inside this function i send a request for a php file that only destroy session but unfortunately my user is'nt logged out

    information logged in users that is saved in database is consist of username , ip address

    thanks alot
    sepideh mohseni
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    if you simply delete cookie the user wont be able to login with its current session (this is probably not a good idea. Cause it may will create lots of garbage in your server).
    now your situation:
    i think you are calling logout.php(or anything like that) using ajax. are you sending any data as post or get to logout.php. now try this first login and then try to call the logout page directly from browser to check if your logout.php is working properly.
    if it use post method try to simple page by which you can send post data and check your logout.php

    Comment

    Working...