PDA

View Full Version : JAVA Cookies Problem


JCharlesHolt
08-14-2002, 01:49 AM
I just purchased vBulletin and got it all installed only to discover that it HATES our Java server. Or rather, the Java server hates the cookies that vBulletin sets. And, unfortunately, vBulletin won't offer any support. So unless I can find a fix, I'm out the $160 I just spent buying vBulletin. Serious bummer.

So hopefully one of you might be able to offer a suggestion (other than just turning off cookies). :) I believe the problem lies in the name of the cookie, particularly the use of brackets []. If this was removed I suspect all would work fine. At least, I hope.

After visiting the forums and reading a message, returning to the homepage on our server results in the following error:

java.lang.IllegalArgumentException: illegal cookie name: bbthreadview[1]
at javax.servlet.http.Cookie.<init>(Cookie.java:103)
at com.caucho.server.http.Request.fillCookie(Request. java:1126)
at com.caucho.server.http.Request.fillCookies(Request .java:1030)
at com.caucho.server.http.Request.getCookie(Request.j ava:1004)
at com.caucho.server.http.Request.findSessionIdFromCo okie(Request.java:1263)
at com.caucho.server.http.Request.getRequestedSession Id(Request.java:1225)
at com.caucho.server.http.AbstractRequest.createSessi on(AbstractRequest.java:423)
at com.caucho.server.http.Request.getSession(Request. java:1167)
at com.caucho.jsp.QPageContext.initialize(QPageContex t.java:104)
at com.caucho.jsp.QJspFactory.getPageContext(QJspFact ory.java:78)
at _home__jsp._jspService(_home__jsp.java:18)
at com.caucho.jsp.JavaPage.service(JavaPage.java:74)
at com.caucho.jsp.Page.subservice(Page.java:485)
at com.caucho.server.http.FilterChainPage.doFilter(Fi lterChainPage.java:181)
at com.caucho.server.http.Invocation.service(Invocati on.java:291)
at com.caucho.server.http.CacheInvocation.service(Cac heInvocation.java:132)
at com.caucho.server.http.RunnerRequest.handleRequest (RunnerRequest.java:341)
at com.caucho.server.http.RunnerRequest.handleConnect ion(RunnerRequest.java:271)
at com.caucho.server.TcpConnection.run(TcpConnection. java:136)
at java.lang.Thread.run(Thread.java:536)

So, uh... any suggestions?

JCharlesHolt
09-15-2002, 05:30 PM
Well, I've still had no luck getting vBulletin to work with Java. vBulletin offers no support on it, and I'm pretty bummed that I shelled out the money for a copy and can't use it.

To reiterate, the bbthreadview cookie that vBulletin sets chokes the java server, due to the square brackets in the name.

I modified the code for vBulletin (v 2.6.6) to set a cookie without the brackets, and that works... but I can't figure out how to modify the PHP in the other files to read the new cookie properly.

In showthread.php, I modified line 253 from "bbthreadview[$threadid]" to "bbthreadview$threadid" and that works.

But in forumdisplay.php (and all other pages that have bbthreadview in them), it's a bit tricker. The code on line 612 reads "$bbthreadview[$thread[threadid]]". Well changing it to "$bbthreadview$thread[threadid]" didn't work at all. Changing it to "$bbthreadview[$threadthreadid] now at least runs, but it isn't reading the same name as the cookie.

I know nothing about PHP, and I was hoping SOMEONE could give me a hint on this. Otherwise, I'm fooged. :(

Any help would be greatly appreciated!

DeadMan384AD
09-15-2002, 06:08 PM
Have you talked to your host? Maybe they can reconfigure the java server for you or something... I know less about this than you do, but hey...

NTLDR
09-15-2002, 08:55 PM
Originally posted by JCharlesHolt
So hopefully one of you might be able to offer a suggestion (other than just turning off cookies).

Can I ask what is wrong with just using sessions and not cookies? I know cookies are better but at least you would have a working board.

Changing the variable to $bbthreadview[$threadthreadid] won't work, as discovered because the threadid bit needs to be in brackets (the []) as it is an element of the $thread array, so in order to remove the brackets you would need to asign that element of the array to a variable beforehand and change the line.