1

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

2 Answers 2

1

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);
0

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.

1
  • 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, 2012 at 0:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .