Hi Fabian,

I am with Hilmar on using existing CMS session.

André, I think you meant the session is available via a built in 
placeholder of type info, <%inf_session_key%>.  No RQL is necessary.

Now to answer the question why when using preexecution, the PHP session is 
different everytime.

CMS first get the information from cache or database, replace the existing 
placeholders with information.  Then the snippets of CMS pages are joined 
into a single web page.  Then the preexecution parser comes in, parses out 
all the pieces of preexecution code and place them into a temp file.  The 
temp file is sent to IIS for execution.  The result is then parsed and 
substituted back into the single web page earlier.  Finally, the single web 
page is displayed on end user's browser.

You might have noticed these keywords: temp file, IIS, temp execution. 
 That is right, each preexecution is temporary and is a new session on the 
IIS.

Also, preexecution make CMS do another round of pass around IIS, adding 1-2 
seconds of extra rendering time per page.  Not scalable for a big project 
with many active users.

Anyways, with your PHP, you can have 

<?php
function GetSession($session_key) {
$ret_session_key = "";

if($session_key == "")
{
$ret_session_key = StartSession();
} else {
SetSession($session_key);
 $ret_session_key = $session_key;
}

return $ret_session_key;
}

$t = GetSession("<%inf_session_key%>");
?> 

On Sunday, August 31, 2014 5:50:07 AM UTC-4, Hilmar Bunjes wrote:
>
> Hi Fabian,
>
> is it possible to get access to the Cookie Data in Active Templates using 
>> PHP?
>>
>> I want to use a PHP session throughout a SmartEdit Session, i.e. the user 
>> should use the same session when browsing through the site in SmartEdit. 
>> For that purpose i call a <?php session_start(); ?> in a PreExecute block 
>> on every page. But with every page opened in SmartEdit, PHP opens a new 
>> session instead of reusing the existing one. The problem is that the cookie 
>> holding the PHPSESSID informaion is not being handed over to the code in 
>> the PreExecute block. When calling var_dump($_COOKIES) the output is 
>> array(0). The cookie is actually created and i can see that it is being 
>> send to the OpenText-Server in the HTTP-Request Header, but OpenText does 
>> not seem to hand this information over to the PreExecute code.
>>
>> Any ideas out there?
>>
>
> If you just want to keep the same session during SmartEdit you could use 
> the CMS session key as PHP session key as well. To do that, the PHP 
> session_id accepts your own string to be used as session key. This would be 
> a replacement of the session key that PHP stores in the cookie otherwise.
>
> I do not think that there is another way to get the PHP session working as 
> you expect.
>
> Best,
> Hilmar
>

-- 
You received this message because you are subscribed to the Google Groups 
"RedDot CMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/reddot-cms-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to