Jump to content

Archived

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

djmonkey1

How long do cookies last?

Recommended Posts

What script sets cookies for customers and for how long do they last?

 

I had imagined that it would be in includes/classes/sessions.php, and after looking through this file again I've come across

 

// Should we send a cookie?
if ($send_cookie) {
  setcookie($session->name, $session->id, $session->cookie_lifetime, $session->cookie_path, $session->cookie_domain);
}

 

But where is "$session->cookie_lifetime" set. At the top of the file we have "var $cookie_lifetime = 0;", but that doesn't make much sense. Not to me anyway.

 

There are other instance of "cookie_lifetime" throughout the code, for instance in application_top.php

// set the session cookie parameters
  if (function_exists('session_set_cookie_params')) {
session_set_cookie_params(0, $cookie_path, $cookie_domain);
 } elseif (function_exists('ini_set')) {
ini_set('session.cookie_lifetime', '0');
ini_set('session.cookie_path', $cookie_path);
ini_set('session.cookie_domain', $cookie_domain);
 }

 

But once again it appears to be setting the lifetime at zero. If a cookie is given no expiration time, then it expires when the user closes their browser, correct? Or is it linked to the osCommerce session id? Do those have an expiration time set somewhere?


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

×