Solved

[urgent] php session suddenly doesn't work

Posted on 2011-02-11
11
445 Views
Last Modified: 2012-05-11
All of the sudden all of my session doesn't work properly. I even copy and paste the sample on the following page:
http://php.net/manual/en/function.session-start.php

when i go to next page, the session variable are empty. print_r($_SESSION) displays nothing. Help me!

0
Comment
Question by:edyonline
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34875862
Is session_start() at the top of every page?
0
 

Author Comment

by:edyonline
ID: 34875872
yes, nothing changed, is this server side issue?
0
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 34875906
Was there any change / update at the web host ?
PHP upgrade ? Do you use cookies with sessions ?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34875917
It has to be because the only thing browsers have to do with the session is possibly storing a cookie with the session id.  And yes, Something has changed or it would be working still.  Make sure there is nothing, not even white space, before the first "<?php" tag.
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 34877159
1. What does your code look like?

2. What happens when you:
echo session_id();
...after session_start()?

3. Have you tried the full steps to reproduce the problem on different browsers or on different networks?

4. If it happens with all browser / all networks, then the problem is definitely on the server, in which case I would first check for any disk space issues, then I would look at my php.ini file to find out where the session files are stored and would double-check to make sure there are no permissions problems there (a file should be created for each new session).
0
 

Author Comment

by:edyonline
ID: 34877232
it's not resolved yet but i think i'm getting close to find the root cause.. everytime I reboot the server, the session works just fine... but after a while the session problem come  back again... maybe something to do with memory or space issue?
0
 

Author Comment

by:edyonline
ID: 34877239
to add more information, I checked the  save_path in php.ini and all files inside that folders have 0 bytes  file. But as i said previously, after reboot immediately everything is good for a while. How do I fix it? what should I look next?
0
 

Author Comment

by:edyonline
ID: 34877300
It's resolved now. The problem was the space issue. 100% on the mounted hd. Freed up some huge files and everything works perfect
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 34877447
I suggested checking for disk space issues.
0
 
LVL 34

Accepted Solution

by:
gr8gonzo earned 500 total points
ID: 34879285
Sorry, that should have been an objection. My comment was that the resolution was a disk space issue, which I first suggested to check, so the objection is to the self-resolution.
0
 

Author Comment

by:edyonline
ID: 34879333
sorry i didn't really read your suggestion carefully because i was in panic mode yesterday. Had I read your suggestion first, I didn't have to go through it my self
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question