Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Keeping Session Active


Guest

Recommended Posts

Posted

Hi guys

 

My plan is to keep a user logged in, even when they navigate out of OSC directories. Therefore, I need to keep the sessions active?

 

Could somebody point me in the right direction as to where to start. I've got some idea's...

 

thanks from sunny Cornwall, UK :blush:

Dan

Posted

Am I not making sense here? :huh: :huh:

Posted

thanks you for your reply, that kind of makes sense, but 'learner' / 'not learn enough' here.

 

can you give me a bit more information please

Posted

Well, when you say "navigate out of OSC", you are going to have to provide a link for them to click on, to take them to an "external" page, yes?

All I'm saying is, don't hard-code the link - build it using a call to the function.

You can link to HTML pages as long as the client accepts cookies, as the session will be stored client-side, otherwise you will need to use php pages and the tep_href_link() function. In fact, probably better not to try to use html pages at all.

Posted

If you already have a lot of html pages and don't want to lose their content, but want them to blend with your osCommerce php pages then do this:

 

Take a root level php page like conditions.php and rename it.

 

Remove this from the head section:

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS);

 

Change this:

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS));

to this:

$breadcrumb->add('new page name here');

 

After the head section strip out left and right columns (if you don't want them), but I'd suggest leaving the header and footer in place (for compatibility). Then, where you see this:

 

<tr>

<td class="main"><?php echo TEXT_INFORMATION; ?></td>

</tr>

 

change it to this:

 

<tr>

<td class="main"><?php include ('htmlpagename.html'); ?></td>

</tr>

 

Then put the html page of the same name in the root of your website.

 

You don't need to add the new php page to includes/filenames.php, your main page content will all be html, but you'll keep the session id.

 

Vger

Posted

Maybe you are confused by this

 

"Take a root level php page like conditions.php and rename it."

 

would be better as:

"Take a root level php page like conditions.php, copy it to a new file and then rename it."

 

 

You are only adding stuff, you do not need to change anything akready there.

Posted
Take a root level php page like conditions.php, copy it to a new file and then rename it.

 

When you open conditions.php (or any other file) and select 'Save As' and choose another name then the page you have on screen will be the new page. The old page (conditions.php) will still be there on your computer, unedited.

 

Vger

Posted

i done exactly what you said, and it didn't work, as soon as i navigate out of /catalog/ back to the sites root directory, i'll lose the sesions, meaning, when i return to /catalog/ i have to sign in again

 

sorry i've i seem thick as two planks, i'm trying, honest

  • 1 year later...
Posted

this worked only for one html-page. e.g page1.html. But if you put a hyperlink from page1.html to page2.html it doesnt stay "inside" the osc anymore.

 

Could this be a way to make a forum (phpbb) "inside" the osc too?

 

If you already have a lot of html pages and don't want to lose their content, but want them to blend with your osCommerce php pages then do this:

 

Take a root level php page like conditions.php and rename it.

 

Remove this from the head section:

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS);

 

Change this:

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS));

to this:

$breadcrumb->add('new page name here');

 

After the head section strip out left and right columns (if you don't want them), but I'd suggest leaving the header and footer in place (for compatibility). Then, where you see this:

 

<tr>

<td class="main"><?php echo TEXT_INFORMATION; ?></td>

</tr>

 

change it to this:

 

<tr>

<td class="main"><?php include ('htmlpagename.html'); ?></td>

</tr>

 

Then put the html page of the same name in the root of your website.

 

You don't need to add the new php page to includes/filenames.php, your main page content will all be html, but you'll keep the session id.

 

Vger

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...