views:

26

answers:

1

Hello everyone.
I am trying something in the zend Framework
I have create a project with zend_tool.

I have 2 controllers

  1. artist controler
  2. account controler

Within the accountcontroller whenever the user login the $_SESSION['id'] is set to the user id. But as soon as I leave the accountcontroller and go to the Artist controller, my session variable is empty.

Here is a link to both full files http://www.codedump.be/code/435/

If you look at the saveArtistAction()

Here I am always redirected to the login form:

if(!isset($_SESSION['id'])){
      $this->_forward('login', 'account');

     }

I am using zf 1.9.5

Can anyone tell me how to solve the problem?

A: 

Have you defined a cookie path for the session? Try making sure it gets set to "/".

Chris Gutierrez
nope,where should i do this in the zf?
sanders
do you have an ini config file? set cookie_path = "/" check out the session config docs. http://framework.zend.com/manual/en/zend.session.global_session_management.html#zend.session.global_session_management.configuration_options
Chris Gutierrez