loginid Posted September 27, 2011 Posted September 27, 2011 Hi All, Hope everyone is well today. Just need a little advice about where to use setCookie Right now I'm trying to set a cookie on a condition in application_top.php What I'm doing is; If http_get_vars = blah then setCookie But because of the limitations of cookies being part of the HTTP header and needing to be set before any output is sent to the browser. I'm finding that the cookie is not getting set because it's encased within the application_top.php code. So I'm wondering - does anyone out there know where in the osCommerce code I can setCookie? Thanks in advance!
satish Posted September 27, 2011 Posted September 27, 2011 if (SESSION_FORCE_COOKIE_USE == 'True') { tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain); in application top will give you some idea on how to set. Satish Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
loginid Posted September 28, 2011 Author Posted September 28, 2011 Hello Satish, Thanks for getting back to me. The problem is around where to setCookie rather than how to set cookie. If I set it in application_top.php then it will not set the cookie as soon as user lands on the page, the user has to navigate to another page first. But the problem is that I need it to setCookie as soon as the user navigates to any page, just in case they navigate to the page and then leave, I still want to set that cookie. Any ideas? :)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.