Post by vaidyamanishjoshi » Tue Jun 01, 2021 2:02 pm

I am using opencart V 3.0.3.0

In oc, I am creating session

Code: Select all

$this->session->data['my_session'] = $my_text;
It is working and creating session.

I want to use this session value in a php script located in image folder of oc.

Code: Select all

<?php
session_start();
if(!empty($_SESSION['my_session'])){
      Do some work.
}
?>
But I am getting

Code: Select all

 $_SESSION['my_session'] NULL
. How can sort it out ?

Active Member

Posts

Joined
Tue Jun 09, 2015 2:47 am

Post by ADD Creative » Tue Jun 01, 2021 7:24 pm

OpenCart 3.x doesn't use PHP sessions, so you can't access with $_SESSION. You would have to include the OpenCart session class and adaptors, as well as read and set the session cookie.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: Amazon [Bot] and 130 guests