eZSESSID in ezhttptool::sendHTTPRequest()

Author Message

Michael Lee

Sunday 04 November 2007 7:12:19 am

Is it possible to support eZSESSID in ezhttptool::sendHTTPRequest?

Can we add another parameter to sendHTTPRequest() as the following?

function sendHTTPRequest($uri,$port,$postParameters, $userAgent, $passthrough, $ezsessionid)

And change the request header as the following?

...
"Cookie : eZSESSID=$ezsessionid".
...

In this way, we can do internal forward with authenticated session on server side.

Or maybe we can add an array parameter named "$cookies" to allow the user to supply additional cookies when invoking sendHTTPRequest() as the following?

function sendHTTPRequest($uri,$port,$postParameters, $userAgent, $passthrough, $cookies)

Please advise.

Michael Lee | Managing Director | ZerusTech Ltd | www.zerustech.com

Skype: zerustech

Kåre Køhler Høvik

Sunday 04 November 2007 12:55:13 pm

Hi

This is a hack, but if you can add custom HTTP headers using the <i>$userAgent</i> parameter. Example:

$userAgent = 'eZ Publish ' . "\r\n" .
                   'Cookie: ' . $mySessionVar;
eZHTTPTool::sendHTTPRequest( 'http://ez.no', 80, false, $userAgent );

Best regards
Kåre

Kåre Høvik

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 15 2025 08:57:18
Script start
Timing: Jan 15 2025 08:57:18
Module start 'layout'
Timing: Jan 15 2025 08:57:18
Module start 'content'
Timing: Jan 15 2025 08:57:19
Module end 'content'
Timing: Jan 15 2025 08:57:19
Script end

Main resources:

Total runtime0.9399 sec
Peak memory usage6,144.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0102 684.7188183.7031
Module start 'layout' 0.01020.0032 868.421952.5938
Module start 'content' 0.01340.9249 921.01561,797.1016
Module end 'content' 0.93830.0015 2,718.117264.8203
Script end 0.9399  2,782.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00840.8966160.0005
Check MTime0.00130.1424160.0001
Mysql Total
Database connection0.00080.083710.0008
Mysqli_queries0.875693.1631540.0162
Looping result0.00050.0483520.0000
Template Total0.886794.320.4434
Template load0.00580.617320.0029
Template processing0.880993.724820.4405
Template load and register function0.00120.124910.0012
states
state_id_array0.00140.152910.0014
state_identifier_array0.00180.187020.0009
Override
Cache load0.00530.5689200.0003
Sytem overhead
Fetch class attribute can translate value0.00040.045820.0002
Fetch class attribute name0.00260.275040.0006
XML
Image XML parsing0.00210.224620.0011
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00380.4002220.0002
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs