Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 10 May 2007, 04:54
Joshva Joshva is offline
 
Join Date: Nov 2005
Question php include in global_start plugin = no cookies!

Hi,

I have the following global_start plugin hook:

ob_start();
require_once('http://www.joshandfriends.com.au:45317/dancemusic/faces/ExternalPlugin.jsp');
$included_file = ob_get_contents();
ob_end_clean();


In the ExternalPlugin.jsp when i look for the cookies of my website it returns nothing at all!!!

When i place:

http://www.joshandfriends.com.au:453...rnalPlugin.jsp

in a browser i can see all cookies logged.

I had this on my old site as well.


Any ideas why i would be receiving no cookies?
Reply With Quote
  #2  
Old 10 May 2007, 19:03
Zero Tolerance's Avatar
Zero Tolerance Zero Tolerance is offline
 
Join Date: Feb 2004
Real name: Scot
The file 'ExternalPlugin.jsp' is being executed by your server, and the contents returned and being saved into "$included_file". The problem exists because it is your server pulling the contents of this file.

Perhaps pass along some variables?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I haven't tested it, but if you could change that script to use http variables then you could do it that way, just change the cookie array for the cookies you want passing through

- Zero Tolerance
Reply With Quote
  #3  
Old 10 May 2007, 23:30
Joshva Joshva is offline
 
Join Date: Nov 2005
Would it make a difference if i gave a relative url for example

require_once("../ExternalPlugin.jsp");

Would it then be passed the cookies in a normal request fashion?

btw thanks for the reply. I will try your code this weekend see if it works for what i need

Last edited by Joshva; 11 May 2007 at 00:03. Reason: Automerged Doublepost
Reply With Quote
  #4  
Old 11 May 2007, 12:11
Zero Tolerance's Avatar
Zero Tolerance Zero Tolerance is offline
 
Join Date: Feb 2004
Real name: Scot
Depends really, some setups will allow you to use require_once with the variables too, some won't, should it fail you can use:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

With this you don't need to use ob_* functions

- Zero Tolerance
Reply With Quote
  #5  
Old 13 May 2007, 06:00
Joshva Joshva is offline
 
Join Date: Nov 2005
OK tried them both. Firstly the suggestion of passing cookies as request parameters.

Their are NO request parameters of any sort received by my jsp.

The request is BLANK!

This is very odd as of course the cookies are empty too.

This suggests that the request is somehow getting totally cleared at some point.

The 2nd suggestion refused to render entirely. I imagine it was a php error.


Any suggestions of where the request would be getting cleared?
Reply With Quote
  #6  
Old 19 May 2007, 08:54
Joshva Joshva is offline
 
Join Date: Nov 2005
Any other advice?

This happens on both Tomcat appserver and also Glassfish app server.

Very stuck on this one
Reply With Quote
  #7  
Old 19 May 2007, 10:21
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
Originally Posted by Joshva View Post
Any ideas why i would be receiving no cookies?
Because your webserver is requesting the page, not you. Webservers don't send cookies with their requests, and even if they did, they wouldn't be yours.
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #8  
Old 19 May 2007, 15:24
Joshva Joshva is offline
 
Join Date: Nov 2005
Ok everyone we are a little further along!


a) Parameters can be passed to the jsp

b) Within the plugin return "count=" . count($_COOKIES); RETURNS 0


So basically even with in the vBulletin plugin i can not access any cookies at all!!!

Any ideas? Is their a particular vbulletin function i need to call to retrieve the cookies

THis doesn't return anything either:

$bbuserinfo['username'];

even though i am logged in.

THis is all in the global start hook

STOP PRESS!!!

I got it working with:




function build_cookie_string()
{
return "bbsessionhash=" . $_COOKIE['bbsessionhash'];
}

ob_start();
require_once('http://www.joshandfriends.com.au/dancemusic/faces/ExternalPlugin.jsp?' . build_cookie_string());

$included_file = ob_get_contents();
ob_end_clean();





Thanks to everyone who helped!

Josh

Last edited by Joshva; 19 May 2007 at 16:06. Reason: Automerged Doublepost
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 15:23.

Layout Options | Width: Wide Color: