2

I have an issue with a project that I am working on, basically the whole application runs as a Drupal 6 install, and I am bootstrapping a Zend Framework Application to pull out the data I need (which I will then make available in various views via a module I will create).

I have the majority of this working correctly, but the issue I am having is with sessions, the actual error I am getting is as follows :-

PHP Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()'

Which I think is happening because Drupal is setting up the session and then ZF is then also trying to setup its own sessions and they are clashing. Is there a way I can override/extend the default Zend Session handling to let it use the Drupal Session API?

Thanks

Rich

1 Answer 1

2

Are you going to actually be storing information in the Zend session? If not, you could do away with starting a Zend session completely, or at least conditionally skip starting the Zend Session if the session has already been started.

If you do, you will not be able to start or use any Zend_Session* related functions (Zend_Session, Zend_Session_Namespace) if a session was previously started with session_start(). There does not appear to be any way around this.

Instead, from your Zend Application, you can just use the $_SESSION superglobal anywhere you need to use session data.

This won't be of much help, but a useful reference is Starting a session in Zend.

Sign up to request clarification or add additional context in comments.

1 Comment

The idea of not starting the session sounds like an option, but I am unsure if the Zend_Session will be used in a bootstrapped version of Zend Framework, I am mainly interested in getting access to the models and reading/writing data to and from them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.