+ Post New Thread
Results 1 to 4 of 4
Web Development Thread, PHP Sessions not working in Coding and Web Development; Hi, I seem to have a sudden problem with PHP Sessions. I wrote a small app a couple of years ...
  1. #1

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    5,838
    Thank Post
    874
    Thanked 938 Times in 775 Posts
    Blog Entries
    9
    Rep Power
    335

    PHP Sessions not working

    Hi,

    I seem to have a sudden problem with PHP Sessions. I wrote a small app a couple of years ago for one of out deputy heads. It's worked fine all through last year.

    This term the sessions, all of a sudden, don't seem to be staving on the server.

    When session_start() is called within the php script, a cookie IS being created on the local machine, I can see it in the Firefox cookies browser. But when I look in C:/temp - the default php session cache - the sessions has not been created.

    I have tried changing the location of the session cache in php.ini and restarting Apache but still no luck.

    I'm running PHP4 and Apache2 on Windows XP.

    Can anyone give me any pointers as to where to look to solve this one?

    Cheers

    Terry.

  2. #2
    Friez's Avatar
    Join Date
    Dec 2006
    Posts
    839
    Thank Post
    22
    Thanked 22 Times in 21 Posts
    Rep Power
    23
    The only thing that I can really think of straight up:

    Make sure session_start() is the first thing that is called and nothing else gets output to the browser (including any header() calls).

  3. #3

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,866
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Check the permissions on the session directory on the server.

  4. #4

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    5,838
    Thank Post
    874
    Thanked 938 Times in 775 Posts
    Blog Entries
    9
    Rep Power
    335
    hi,

    did both of those, like I say was working before summer - after summer nothing. I came up with a solution in the end! One of the Junior Techs had built a XAMPP server to do some development testing with. I migrated the database and website to that and it runs fine - go figure!

    Cheers
    Terry

SHARE:
+ Post New Thread

Similar Threads

  1. MS Terminal Server Sessions
    By Jonny_sims in forum Thin Client and Virtual Machines
    Replies: 6
    Last Post: 12th May 2010, 11:30 PM
  2. Ghost sessions
    By Griffo in forum Network and Classroom Management
    Replies: 1
    Last Post: 4th September 2008, 05:59 PM
  3. Scrpting and RDP sessions
    By Danieltopia in forum Wireless Networks
    Replies: 2
    Last Post: 10th April 2008, 10:25 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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