Mantis - Quercus
Viewing Issue Advanced Details
3980 crash always 04-03-10 20:19 04-11-10 16:30
new 4.0.3  
0003980: using php session_start() always causes a crash

I'm using quercus 4.0.3 from ColdFusion 8 and the cf_php tag provided by sean corfield.

Whenever any php script calls session_start inside a cf_php tag it results in a crash. See the crash log snippet in additional information.

I've worked around my issue temporarily by changing and subclassing some symfony core files to write the data to a standard array which is then serialized to the database the same way a php session would be. As a side effect I was also unable to use session_encode.

It should be noted, I'm not expecting the session commands to communicate with the browser or set cookies. I'm happy to pass the session id back to CF to do that. I just need all the internal session functionality so I don't need to change symfony code.
My goal is to use enough of symfony php framework to let coldfusion pass some information to a php session accessed by symfony for the same user logged into CF. My idea was to use symfony itself to do all the session handling so I'm not trying to replicate work already done. My hack has worked. All that remains is getting quercus to allow session_start() to work so I don't have to change symfony core files.

    at com.caucho.quercus.lib.session.SessionModule.session_start(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at com.caucho.quercus.module.StaticFunction.invoke(
    at com.caucho.quercus.env.JavaInvoker.callMethod(
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(
    at com.caucho.quercus.expr.FunctionExpr.eval(
    at com.caucho.quercus.expr.Expr.evalTop(
    at com.caucho.quercus.statement.ExprStatement.execute(
    at com.caucho.quercus.statement.BlockStatement.execute(
    at com.caucho.quercus.program.QuercusProgram.execute(
    at com.caucho.quercus.script.QuercusCompiledScript.eval(
    at javax.script.CompiledScript.eval(

04-03-10 20:38   
After looking at the quercus source, I assume the problem is getRequest or getCookies don't exist or are inaccessible to quercus outside of resin. As I am not fluent in java or quercus structure I have not investigated further than that.

04-05-10 22:39   
As a workaround, you can set the php-ini session.use_cookies=0:


ini_set("session.use_cookies", 0);

04-11-10 16:30   
I tried this, I got a new error in createSession.

  public SessionArrayValue createSession(String sessionId, boolean create)
    long now = Alarm.getCurrentTime();

    SessionCallback callback = getSessionCallback();

line 1562 com/caucho/quercus/env/