SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Help me: session problems...

    Hi,

    Everyone OK?

    I'm new to PHP, and have started to build a site with it.
    On this site I'm trying to build a member's section, but i'm having trouble with session management. I based the session stuff on a great article I found here, written by Kevin Yank.

    However, I seem to keep losing sessions intermittently, and with no discernible pattern. At home, it all works fine, on an XP machine with Apache and PHP 4.2.2. On the net it's on a Unix machine with a Zeus webserver and PHP 4.2.1 (I think).

    When clicking around after having logged in, it all works fine until all of a sudden the login page appears again. Instead of logging in, clicking 'Member login' (which is just one of the protected pages, and not a seperate log in form) the protected page is shown again. Weird.

    Does anyone have any idea what's going on? I can understand why sessions stuff might not work at all (e.g. server settings) but I have no idea as to why it works MOST of the time, but not ALL of the time. Any ideas, advice or suggestions would be gratly appreciated. If someone wants to help me out, I'd be happy to send the code (it's too much to post here).

    Thanks,
    Alex

  2. #2
    Probably eating pie mitsubishi's Avatar
    Join Date
    Sep 2001
    Location
    England, UK
    Posts
    405
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doesn't sound like a problem with the session if you can jump back into it, more like how you're checking the session.
    Try and see if the session is being lost on certain pages or under a certain set of events. Also try surfing with and without cookies.

  3. #3
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what I thought, but...

    Basically i have two pages now, called (would you believe it page1.php and page2.php). I call page1.php in the browser, login and get to see the page. I switch to page2.php and also see the page, after going to and fro for a while, without any problems, all of a sudden I get a login screen on page1.php! If I then go to page 2.php, nothings wrong...

    I also tried the cookie thing. Blocking cookies means I can't log in. Allowing all cookies or using IE6's medium setting allows me to log in, until the problem occurs...

    Alex


Bookmarks

Posting Permissions

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