How to set a session variable?

Author Message

Kevin Jonkers

Friday 18 November 2005 9:52:27 am

Is it possible to set a session variable in eZPublish? I don't want to keep passing around variables by GET or POST...

Ɓukasz Serwatka

Monday 21 November 2005 6:25:29 am

This is not possible from template by default. You can use e.g custom template operator however here you can expect some limitation because of view caching.

If the view cache has been generated for a page and the next user requests it the template code will not be run. Disable view cache for tpl might help but cost of doing this will be performance.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Kevin Jonkers

Monday 21 November 2005 8:12:44 am

How is it possible that a big system like EZ doesn't have a function for this?

Pretty stupid I need to pass around variables all the time, but I guess that is the way to go...

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 19 2025 03:26:15
Script start
Timing: Jan 19 2025 03:26:15
Module start 'layout'
Timing: Jan 19 2025 03:26:15
Module start 'content'
Timing: Jan 19 2025 03:26:17
Module end 'content'
Timing: Jan 19 2025 03:26:17
Script end

Main resources:

Total runtime1.5740 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 590.2891152.6250
Module start 'layout' 0.00470.0127 742.914139.4453
Module start 'content' 0.01741.5551 782.3594531.8125
Module end 'content' 1.57250.0014 1,314.17198.3203
Script end 1.5739  1,322.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.1935160.0002
Check MTime0.00120.0794160.0001
Mysql Total
Database connection0.00080.049910.0008
Mysqli_queries1.522496.7277570.0267
Looping result0.00060.0388550.0000
Template Total1.528197.120.7641
Template load0.00180.115120.0009
Template processing1.526396.971320.7631
Template load and register function0.00020.011210.0002
states
state_id_array0.00210.131010.0021
state_identifier_array0.00150.096220.0008
Override
Cache load0.00140.0915110.0001
Sytem overhead
Fetch class attribute can translate value0.00050.034620.0003
Fetch class attribute name0.00110.069440.0003
XML
Image XML parsing0.00080.049720.0004
class_abstraction
Instantiating content class attribute0.00000.000540.0000
General
dbfile0.00100.0609180.0001
String conversion0.00000.000740.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs