Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

how can i make the session starts


Recommended Posts

it is appended after a link is clicked i wanted to make it as you enter the site

take a look at my site here My Webpage

no categories untill a link is clicked or the page is refreshed. i want the session to start before or a way to overcome this problem

i have put a condition to show some of categories based on the subdomain that they come from by having store_id value in the url and then adding this to the session but i am now having this problem


Link to comment
Share on other sites

I think the post is referring to the session ID appearing rather than the session actually being started or not.

The problem is that on the first page request, there is no way to retrieve the client-side cookie - this is why it is necessary to append the session ID on the first page link - if this is what you are worried about, you can force cookie usage.

The other option is a lot more complicated and would involve redirects from every page on your site to a "hidden" script, passing the session ID, then redirecting straight back, to check if cookies are enabled or not.

This approach can work, but is beyond a beginner's ability to pull off, and you'd still need the session IDs if cookies are disabled client side.

Link to comment
Share on other sites

i do not mean the session id when i refer to store_id but this is a diffrent variable that i have added to the session

if you click on this link or second link you will see what my problem is.

although i have the store_id variable available since i can echo it in the categories box for some reason my categories do not appear .

i have a condition in my includes/boxes/categories.php to limit the categories that appear based on the store_id but although it works after the link is clicked it does not work before so i thought it has to do with the session. there might be another problem or maybe the categories list is generated in a diffrent file any help would be appreciated

Link to comment
Share on other sites

If you need to pass a parameter throughout the store, your best bet is to store it in the $_SESSION superglobal - I think OSC uses the tep_session_register() function to achieve the same effect.

Once stored in the session, the variable should be available as long as the session is active.


I do not know why your categories are not appearing - I guess the code that is checking for the store_id is not working properly.

Link to comment
Share on other sites


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

  • Create New...