Search

Hello,

I am new to Symphony CMS and its been two days since I am struggling with this particular problem. Maybe some of more experienced Symphony guys can give me an advice?

I want to show an image that was saved in a session variable (let’s say $_SESSION[“image”]. I am showing that image using tag like this:

<img src="http://mydomain/getchart.php?someid"/> 

getchart.php is supposed to fetch the image from that session variable and after printing correct headers display the image. This works well in my other simple examples, but not with Symphony. Although getchart.php initializes the session:

if (!session_id()) session_start();

I found that it has no access to session variables stored inside Symphony framework. So my guess is that since getchart.php is not run from inside Symphony framework (it doesn’t have that Symphony bootstrap) the session variables that were initialized in Symphony’s datasource are not accessible to getchart.php.

How should I initialize session in getchart.php that it could access Symphony’s session variables? Or maybe there is another way to do that? Of course I could save a generated image in a file, but since I am generating images on a run it would be more convenient to save them temporary in a session variable instead of accumulating many image files on disk and then regularly cleaning them.

Any suggestions?

Thank you,

Julius

Take a look at this discussion.

In your specific case I’d go with file based caching with periodic purging if there’s a lot of data.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details