urgent! important! how to store session variables?????

Author Message

Alessandro Cipriani

Tuesday 09 March 2004 2:29:29 am

hi all
i've this GREAT problem due to my need to store a variable in session and to the lack of documentation (and forum answers) about it.
i've seen also some documentation here:
http://doc.ez.no/class_ref/doc/view/ezsession5a62.html?PrintableVersion=enabled#999999
but i don't understand how to use the example in it!!!
i even tried to insert the code into the index.php code, but i get only a fatal error...

i said: if there is the possibility to store variable values in session, WHY there isn't enough documentation about it????

best regards
alessandro

Alessandro Cipriani

Tuesday 09 March 2004 3:06:01 am

thank you mark
can you post some code please?
i'm quite new to this, but i must do it and i don't know h o w....

best regards
alessandro

Alessandro Cipriani

Tuesday 09 March 2004 3:59:04 am

thanks! it works perfectly!!!
just another question: in my index.php i'd like to get the session id or a timestamp (like currentdate()) in order to identify the current session with a unique value.
so if index.php is running for the first time (for this session) it should retrieve the unique number and store in the session. otherwise it should view that that value is already set and do nothing

questions:
- how to retrieve timestamp/sessionid?
- how to make index.php to know if the value of that variable is already set

thanks a lot mark!
you are being helpfull to me!!!!!

cheers
alessandro

Alessandro Cipriani

Tuesday 09 March 2004 4:05:53 am

mark when you write

value="{"Telephone"|session_variable}"/></td>

what do you mean with "session_variable"?

in my index.php i wrote:
$http =& eZHTTPTool::instance();
$http->setSessionVariable( "MyVar", "MyValue" );

and to retrieve the myVar value (MyValue) in my pagelayout.tpl i wrote:
{"MyVar"|session_variable}

but i doesn't work! i get MyVar, not his value... any hint

best regards
alessandro

Alessandro Cipriani

Tuesday 09 March 2004 5:11:08 am

mark please
can you be more clear?
should i write my own function?
if i should, where should i put the function?

is it the only way to retrieve session variables stored by httptool?

cheers
alessandro

Alessandro Cipriani

Tuesday 09 March 2004 5:12:19 am

can you post the session_variable function code?

best regards
alessandro

Alessandro Cipriani

Tuesday 09 March 2004 7:04:29 am

mark
thank you for the advice... :)
i'm not able to make it work, but i'll write you what i've done:

-index.php, after row 333 (eZSessionStart();)
added the following: $http =& eZHTTPTool::instance();
$http->setSessionVariable( "MyVar", "MyValue" );
[in this way i think i've set a session variable (MyVar) with value "MyValue"]

-eztemplatestringoperator.php, row 301
added the following: // return a session variable
case $this->SessionVariable:
{
include_once( "lib/ezutils/classes/ezhttptool.php" );
$http =& eZHTTPTool::instance();
$operatorValue = $http->sessionVariable("MyVar");
} break;
i wrote sessionvariable("MyVar") because i want to retrieve only the myvar value

-pagelayout.tpl: added the following:
{"MyVar"|SessionVariable}
i want to retrieve the session variable.

but in pagelayout i get "MyVar"... not myValue!!!!

i can give you my icq#: 326457502
help me please (then i'll take a very very long breath!!!)

cheers alessandro

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 31 2025 06:16:15
Script start
Timing: Jan 31 2025 06:16:15
Module start 'layout'
Timing: Jan 31 2025 06:16:15
Module start 'content'
Timing: Jan 31 2025 06:16:15
Module end 'content'
Timing: Jan 31 2025 06:16:15
Script end

Main resources:

Total runtime0.0126 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 588.2813151.2266
Module start 'layout' 0.00430.0026 739.507836.6797
Module start 'content' 0.00680.0044 776.187598.1875
Module end 'content' 0.01130.0013 874.375041.9922
Script end 0.0125  916.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002116.6395140.0001
Check MTime0.00107.9676140.0001
Mysql Total
Database connection0.00064.833310.0006
Mysqli_queries0.002418.919430.0008
Looping result0.00000.096810.0000
Template Total0.00107.710.0010
Template load0.00075.837610.0007
Template processing0.00021.775010.0002
Override
Cache load0.00054.108110.0005
General
dbfile0.00118.689080.0001
String conversion0.00000.074040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs