Mantis - Quercus
Viewing Issue Advanced Details
3980 crash always 04-03-10 20:19 04-11-10 16:30
dleute  
 
normal  
new 4.0.3  
open  
none    
none  
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.

java.lang.NullPointerException
    at com.caucho.quercus.lib.session.SessionModule.session_start(SessionModule.java:421)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.caucho.quercus.module.StaticFunction.invoke(StaticFunction.java:135)
    at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java:686)
    at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:605)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:187)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:127)
    at com.caucho.quercus.expr.Expr.evalTop(Expr.java:376)
    at com.caucho.quercus.statement.ExprStatement.execute(ExprStatement.java:67)
    at com.caucho.quercus.statement.BlockStatement.execute(BlockStatement.java:105)
    at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:396)
    at com.caucho.quercus.script.QuercusCompiledScript.eval(QuercusCompiledScript.java:96)
    at javax.script.CompiledScript.eval(CompiledScript.java:89)

Notes
(0004517)
dleute   
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.

Thanks!
(0004518)
nam   
04-05-10 22:39   
As a workaround, you can set the php-ini session.use_cookies=0:

<?php

ini_set("session.use_cookies", 0);

?>
(0004522)
dleute   
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/Env.java