0

I don't know if I missed something while developing my application using Zend_Framwork, but here's my problem, I can't see any cookies, when I run my application on host server, but on my WAMP server everything worked well ..

I stock on sessions, user information to use it later, so on host server I can't login..

I use Zend_Auth and Zend_Acl, here's my bootstrap

$modelLoader = new Zend_Application_Module_Autoloader ( array ('basePath' => APPLICATION_PATH, 'namespace' => '', 'resourceTypes' => array ('form' => array ('path' => 'forms/', 'namespace' => 'Form_' ) ) ) );

    $this->_acl = new Application_Plugin_Acl ();
    $this->_auth = Zend_Auth::getInstance ();

I also use Zend_Auth getStorage()->write('...') to write infos in sessions. And I have nothing related to sessions on my application.ini

Imad BELHAUSS
  • 71
  • 1
  • 2
  • 10
  • What is the session.save_path? Does the webserver process have permissions to write there? – David Weinraub Aug 27 '12 at 05:20
  • I tried 2 path, the default one and when I added in my application.ini this resources.session.save_path = APPLICATION_PATH "/../data/session", same result in both cases :/ – Imad BELHAUSS Aug 27 '12 at 22:04
  • And you're sure that the web-server process has permissions to write into the `data/session` directory? I usually have to explicitly set those permissions (0755; sometimes - to my shame - even 0777 for testing) on that directory. – David Weinraub Aug 28 '12 at 05:32
  • Hi, for the default path the process have the permission to write, but for the data/session, I'm not sure how to set those permissions, for the session directory I already set it to 0777, but not for data and the whole tree .. – Imad BELHAUSS Aug 28 '12 at 19:05
  • OK, if you've tried 0777 and still no dice, then it's probably not the directory permissions issue I was targeting. Must be something else. ;-( – David Weinraub Aug 29 '12 at 02:39

1 Answers1

1

So, it is WORKING on WAMP but, not on host servers. I presume you mean to say your VPS or dedicated server or say any cloud.

Zend_Auth uses $_SESSION and it has many functions operating on it. For instance, $_SESSION['Zend_Auth']['storage'] will give you information about what is in your hasIdentity() checking stuff.

So, what you should do is, get this pasted somewhere near the code and run it, just for your reference

echo '<pre>';
print_r($_SESSION);

Also, you can't see Cookies because they are session cookies which has 1 reference on client machine and rest all are on file system (if not configured) of the server.

Hope that helps.

Questions?

Keval Domadia
  • 4,768
  • 1
  • 37
  • 64
  • I tried to print the $_Session on my VPS, and it was null, nothing on it, what I mean by I can't see cookies, when I run it in Wamp I see somthing like PHPSESSID containing a Hash, while on my VPS it got nothing "this site Has no cookies". – Imad BELHAUSS Aug 26 '12 at 17:01
  • Excellent. and it does not work on your VPS either... which means, your VPS does not set cookies. Checking PHP.ini file. – Keval Domadia Aug 27 '12 at 04:14