0

I have a PHP project, which also has a Kohana PHP project in a subfolder on the site "/reports".

I redirect to the reports project like so:

redirectreports.php

<?php
session_start();
header('Location: /reports');
exit();

When a user clicks the href link, it opens the above in a new window. On the first click of the link, everything works fine and session data is available in the reports project.

The issue happens when I close the window of reports, and then click the reports link a 2nd time. My session data cannot be found the 2nd time I am redirected to reports.

I have tried passing the session id in the query string and then passing that to Session::instance('native', $_GET['id']);

But still get the following error:

Session_Exception [ 1 ]: Error reading session data.

Adam Copley
  • 1,495
  • 1
  • 13
  • 31
  • Have a look to https://stackoverflow.com/questions/6679007/share-session-between-two-websites ... Looks like a similar issue – clobee Dec 12 '18 at 17:07
  • Error is thrown here: https://github.com/koseven/koseven/blob/master/system/classes/Kohana/Session.php#L324 Make dirty hack and check what is in original error, eg by: `throw $e` – bato3 Feb 28 '19 at 12:20

1 Answers1

0

Thanks for the comments.

The actual issue here was that there was an object being stored in the session data by the "reports" package. Result in a __PHP_Incomplete_Class error.

That class wasn't accessible to the core project and so the shared info is stored as an array rather than an object.

Adam Copley
  • 1,495
  • 1
  • 13
  • 31