Hi Guys, I'm pretty new to laravel and I've inherited a project that was created by an external developer.
The project is basically an Iframed mini-site that's used on multiple websites, it dynamically changes the content by means of a querystring parameter passed to the iframe in the url - the parameter is called 'site'
There is a HomeController setup which in turn 'hands off' to a service which has been created to handle the steps in the mini-site (follows):
public function __construct(StepsService $service, SubmissionService $bsservice)
{
$this->service = $service;
$this->bsservice = $bsservice;
}
public function index(Request $request)
{
return $this->service->step($request);
}
}
The step 'service' handles the session variables etc. (follows).
class StepsService extends WebService
{
public function __construct(SubmissionService $bss)
{
$this->bss = $bss;
}
public function step($request)
{
if ($request->has('site')) {
$request->session()->put('quote-site', $request->get('site'));
}
if ($request->session()->has('quote-site')) {
switch ($request->session()->get('quote-site')) {
case 1:
return $this->step_site1($request);
case 2:
return $this->step_site2($request);
default:
return 'ERROR #1';
}
} else {
return 'ERROR #2';
}
}
}
Now comes the issue (thanks for bearing with!)...
Sporadically - we're seeing the 'ERROR #2' returned instead of the corresponding step. It looks as if the session variable 'quote-site' is not being recognised as set (if ($request->session()->has('quote-site')) {) - even though it's set on the preceding line? ($request->session()->put('quote-site', $request->get('site'));)
Any ideas would be gratefully receieved... IF you need any more info, please ask away..
thanks
James