Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I create a custom cookie/session variable?


losttime

Recommended Posts

Posted

I have noticed that once I am logged into my store, I am able to call php pages that reference variables such as $customer_id and $customer_first_name without having previously defined them.

 

I am unfamiliar with the details of cookies and sessions, but it seems like I can call these specific variables because they are stored in a cookie or session.

 

QUESTION: How do I add a variable to this group of cookied/sessioned variables? I have located these:

 

$check_customer_query = tep_db_query("query to get customers_id");

$check_customer = tep_db_fetch_array($check_customer_query);

$customer_id = $check_customer['customers_id'];

tep_session_register('customer_id');

 

and re-created them with my custom information, but it doesn't seem to work. Am I missing something?

 

- David

Posted

Nevermind.

 

I realized that I had left a blank field in my database and the variable was returning exactly what it was supposed to .... nothing.

Archived

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

×
×
  • Create New...