Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Suddenly a few days ago I have noticed that in my website, when I complete a form of a place for example (POST) and then I do a redirect to view that place, the user session gets lost. If I refresh that page, I'm connected again. It happens also in another form+redirect.

That only happens on the production server. On staging (same configuration as production) and local is working fine.

My stack in production is Apache, memcache (sessions), PHP, Symfony1.4, MySQL.

Any idea on where I should be looking? Apache, what? Memcache?

thanks!

Edit

  • It's not suhosin, as I haven't enabled the extension
  • I happens only after POSTs and a Header redirect
share|improve this question

2 Answers 2

up vote 1 down vote accepted

I found the error, and it has nothing to do with that. The following code was breaking it. I've just commented it. Still don't know why, but at least the bug is out. I will have to ask the symfony guys.

// clear cache
$cacheDriver = $this->getTable()->getAttribute(Doctrine::ATTR_RESULT_CACHE);
$cacheDriver->deleteByPrefix('tour.'.$this->id);
share|improve this answer

I'm guessing one of two things:

  1. a session_start() is missing
  2. You're not using session cookies and the request variable was lost when doing header('Location', ...)

I'd use Firebug and its Persist option in the Net panel to check if all requests have carried the PHPSESSID cookie or request variable. Assuming it does, I'd check if session_start() was missing on the Location header's target page.

share|improve this answer
    
thanks luis, but it wasn't about that. I debug it live line by line until I found 2 lines in the model that were breaking the redirection. Not sure why yet! It must be a symfony bug. –  fesja Feb 18 '12 at 0:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.