Skip to content

Instantly share code, notes, and snippets.

@darron
Created April 19, 2010 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darron/371214 to your computer and use it in GitHub Desktop.
Save darron/371214 to your computer and use it in GitHub Desktop.
function __construct() {
- @session_start();
+ if ((defined('IN_NTERCHANGE') && IN_NTERCHANGE) || (defined('GLOBAL_SESSION_COOKIE') && GLOBAL_SESSION_COOKIE == true)) {
+ @session_start();
+ } elseif (defined('GLOBAL_SESSION_COOKIE') && GLOBAL_SESSION_COOKIE == false) {
+ // Do nothing.
+ } else {
+ // Default behaviour
+ @session_start();
+ }
@darron
Copy link
Author

darron commented Apr 19, 2010

So - this attempts to solve the problem of too many useless session cookies.

If you're in nterchange OR you've set GLOBAL_SESSION_COOKIE to true - it starts a session.
If it's set to FALSE - then it doesn't set a session.
Otherwise, it does the default behaviour, which is to start one.

Comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment