Solved

[urgent] php session suddenly doesn't work

Posted on 2011-02-11
11
441 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 82

Expert Comment

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

Author Comment

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

Expert Comment

by:Lukasz Chmielewski
Comment Utility
Was there any change / update at the web host ?
PHP upgrade ? Do you use cookies with sessions ?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:edyonline
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I suggested checking for disk space issues.
0
 
LVL 34

Accepted Solution

by:
gr8gonzo earned 500 total points
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now