This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » Installation and setup » User sessions do not persist on Ubuntu Server
User sessions do not persist on Ubuntu Server [message #99640] Mon, 24 May 2010 03:40 Go to next message
dklanac  is currently offline dklanac
Messages: 9
Registered: May 2009
Location: Atlanta, GA
Junior Member
I've noticed two issues, which I believe are symptomatic of a larger sessions problem on the latest Ubuntu Server w/ PHP 5.3 installed.

- attributeHolder() does not maintain state
- sfDoctrineGuard is unable to set 'symfony' cookie

I've attempted to do a comparison between my local dev and remote php.ini files, but I'm unable to see any major differences.

Environments:

Local Dev:
- OS X 10.6
- PHP 5.3
- Symfony 1.4 w/ Doctrine

Remote Server
- Ubuntu Server 10.04 LTS
- PHP 5.3
- Symfony 1.4 w/ Doctrine

How could I fix both of these problems?
Re: User sessions do not persist on Ubuntu Server [message #99661 is a reply to message #99640 ] Mon, 24 May 2010 10:27 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Is that 5.3.0 in both cases? An update release could be enough to introduce a serious bug - insofar as it's happened before in PHP.

I don't think non-matching update releases of symfony would make a difference, as the unit testing would catch it. But just to confirm, what version are you using: 1.4.4?

I would be inclined to write a small non-symfony script in order to prove that the issue is with the server stack and not symfony. Also I would google "ubuntu cookie php 5.3" to see if other people have hit this problem too.


Remember Palestine
Re: User sessions do not persist on Ubuntu Server [message #99708 is a reply to message #99661 ] Mon, 24 May 2010 17:27 Go to previous messageGo to next message
dklanac  is currently offline dklanac
Messages: 9
Registered: May 2009
Location: Atlanta, GA
Junior Member
Thanks Fabian. I suspected that it is an overly cautious Debian setting of some kind, so I started looking into cookies on Ubuntu without much luck yesterday. Regarding your thoughts about the minor point releases, here are the PHP 5 versions that I'm dealing with:

Local Dev (everything works in this environment, BTW!):
- PHP 5.3.1
- Symfony 1.4.1

Remote Ubuntu Server
- PHP 5.3.2-1ubuntu4 with Suhosin-Patch
- Symfony 1.4.1

I'll try your suggestion to write a non-Symfony script. I'll see if I can start a session and also set a cookie manually. Are there any known problems with the PHP 5 or Symfony versions that I am running?
Re: User sessions do not persist on Ubuntu Server [message #99751 is a reply to message #99640 ] Tue, 25 May 2010 11:21 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
halfer, not fabien; I know, the email notifications are confusing! Smile All emails appear to come from fabien.

I don't know PHP releases well enough to answer that question, just thought it might be a possibility.


Remember Palestine
Re: User sessions do not persist on Ubuntu Server [message #99765 is a reply to message #99751 ] Tue, 25 May 2010 15:27 Go to previous messageGo to next message
dklanac  is currently offline dklanac
Messages: 9
Registered: May 2009
Location: Atlanta, GA
Junior Member
Haha. My mistake! I promise that my attention to detail is better than I've demonstrated here. My guess is that it's not PHP or Symfony but something that is intrinsic to my Ubuntu installation. Could be a simple directory permissions problem that I haven't identified.
Re: User sessions do not persist on Ubuntu Server [message #100870 is a reply to message #99765 ] Mon, 14 June 2010 00:28 Go to previous messageGo to next message
dklanac  is currently offline dklanac
Messages: 9
Registered: May 2009
Location: Atlanta, GA
Junior Member
OK. I finally got around to working on isolating this cookie issue, and I am still unable to resolve it.

I was able to execute the following test scripts outside of Symfony just fine:

setcookie.php
=================
<?php
$value = 'something from somewhere';

setcookie("TestCookie", $value);
?>


getcookie.php
=================
<?php
echo $_COOKIE["TestCookie"];
?>

I did some research and dug up a recent PHP 5.3.2 bug filing that seems to describe an issue with phpBB and cookies:
http://bugs.php.net/bug.php?id=52018

[Updated on: Mon, 14 June 2010 00:35]

Re: User sessions do not persist on Ubuntu Server [message #100874 is a reply to message #100870 ] Mon, 14 June 2010 01:53 Go to previous messageGo to next message
dklanac  is currently offline dklanac
Messages: 9
Registered: May 2009
Location: Atlanta, GA
Junior Member
I compiled 5.3.1 on my Ubuntu server to see if the issue could be resolved, since that is my local environment point release. It still exhibited the same behavior.

I also updated my version of Symfony to 1.4.5 to no avail.

[Updated on: Mon, 14 June 2010 01:59]

Re: User sessions do not persist on Ubuntu Server [message #100883 is a reply to message #99640 ] Mon, 14 June 2010 10:31 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I haven't come across any other reports of the same behaviour, as far as I can recall. Drop down to the latest version of PHP 5.2, or do some Firebug tracing on the server, to see if/when new cookies are generated?


Remember Palestine
Re: User sessions do not persist on Ubuntu Server [message #100918 is a reply to message #100883 ] Mon, 14 June 2010 16:23 Go to previous messageGo to next message
dklanac  is currently offline dklanac
Messages: 9
Registered: May 2009
Location: Atlanta, GA
Junior Member
Lucky for me, I was able to get around the issue with a wholesale reinstall of Ubuntu Lucid and using Zend Server CE. My best guess is that there is a required library that was not installed. I should also note here that the Suhosin patch is not enabled with Zend Server. Not sure if that plays into things.

[Updated on: Mon, 14 June 2010 16:25]

Re: User sessions do not persist on Ubuntu Server [message #100928 is a reply to message #100918 ] Mon, 14 June 2010 19:33 Go to previous message
dklanac  is currently offline dklanac
Messages: 9
Registered: May 2009
Location: Atlanta, GA
Junior Member
Here is my final post. I figured out that the issue was only on my test environment. sfSessionTestStorage was not setting the cookie that I needed. I changed it over to sfSessionStorage and renamed my cookie with a "test" suffix to prevent production cookie conflicts, and things behaved appropriately. This would also explain why I was able to see the correct behavior on my dev instance, since it also uses the regular sfSessionStorage class.
Previous Topic:Alias set-up from symfony cookbook.... htaccess issue?
Next Topic:sfControlPanel 500 error
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software