Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Session Question

    I'm using sessions on an Intranet with MySql based authentication.

    A user will quite happily not encounter an error with the session if they use the internal links. (if there is an error, a please log-in again page appears).

    If, however, they click a link that opens in a new window, close the new window then try to continue browsing the intranet, the session is gone and they get the login message. This also happens if they click a link to try to download a file.

    What can I do/change to prevent this happening?
    I've read a thread about using cookies instead of sessions, but at the moment I know even less about cookies then I do about sessions.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,073
    Thanks
    11
    Thanked 98 Times in 96 Posts
    If a user closes ALL browser windows then the session will be lost (by default) .. you can use

    ini_set("session.cookie_lifetime",$seconds);

    which will extend the life of the session beyond the closing of the browser window , though garbage collection limits the true 'useful' life of the session cookie.

    If you are saying that the user is not closing all windows but still losing the session then its real hard to guess what the exact problem is, I assume that all pages that require sessions use session_start() in the script ?
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

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