Solved

[urgent] php session suddenly doesn't work

Posted on 2011-02-11
11
442 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

912 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

16 Experts available now in Live!

Get 1:1 Help Now