Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2002
    Location
    Long Island
    Posts
    427

    PHP Sessions!! Why can't they get along??

    I have created a site wher user are required to login.

    It checks the MySQL database and of course if user is aloud to enter, they may.


    Once they are in and when they are finished they close the browser, on certain version of 98 and IE the session is still active.

    Now that is fine b/c when you open a new browser it creates a new session but not in the case on 98/IE. It has the same session ID number, I have to destory the session in order for me to create a new one.

    is there anyway around this?

    it seems to only happen on windows 98.. it seems to work with 2000 pro /xp with any problems

    John

  2. #2
    Join Date
    Jul 2002
    Location
    Israel
    Posts
    351
    Make sure you set the session timeout to a reasonable value.
    You could also request that the users explicitly click on a "Log out" link, which will call session_destroy() and end the session.
    C#/C++/TCL/Python/PHP developer.
    mark at mark org il

  3. #3
    Or you could make it so when a session is duplicated, you can destroy all headers on that session a little more complicated then lewney's way.

  4. #4
    Join Date
    Aug 2002
    Posts
    190
    Managing Users with PHP Sessions and MySQL: http://www.webmasterbase.com/article.php?pid=0&aid=319

  5. #5
    Join Date
    Aug 2002
    Location
    Long Island
    Posts
    427
    ChickenSteak,

    You gave me a great idea, thanks.

    What was happening was once a user logged into the site, and closed the browser. If they went back to the site it would say that they were already logged in.

    So now what I did was checked to see if the session was this active and destroyed it if they went to the home page. I personality don't think this is a good idea b/c they could still go directly to a full url link and edit and change things after the user got up and walked away.

    I also have a logout link on the top of every page. If they logout there will be little/no problems

    John
    John Trovato
    In Office Networks, LLC
    Programmer, Cisco Network Engineer, Roofer, Biochemist, and Conductor.

  6. #6
    Join Date
    Sep 2002
    Posts
    677
    maybe one of the session is male and the other is female.... bad humour aside, setting a reasonable timeout value will help. Also make sure you disable caching. Sometimes that causes people to think they have a problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •