Bin will be removed on June 1, 2014 in favor of http://gist.github.com. Please save all your pastes before then. So long, and thanks for all the fish!×
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
$modelName = Configure::read('Session.model');
$database = Configure::read('Session.database');
$table = Configure::read('Session.table');
 
if (empty($database)) {
    $database = 'default';
}
$settings = array(
    'class' => 'Session',
    'alias' => 'Session',
    'table' => 'cake_sessions',
    'ds' => $database
);
if (!empty($modelName)) {
    $settings['class'] = $modelName;
}
if (!empty($table)) {
    $settings['table'] = $table;
}
ClassRegistry::init($settings);
 
if (empty($_SESSION)) {
    ini_set('session.use_trans_sid', 0);
    ini_set('url_rewriter.tags', '');
    ini_set('session.save_handler', 'user');
    ini_set('session.serialize_handler', 'php');
    ini_set('session.use_cookies', 1);
    ini_set('session.name', Configure::read('Session.cookie'));
    ini_set('session.cookie_lifetime', 0);
    ini_set('session.cookie_path', $this->path);
    ini_set('session.auto_start', 0);
    ini_set('session.referer_check', null);
}
 
    array('CakeSession','__open'),
    array('CakeSession', '__close'),
    array('CakeSession', '__read'),
    array('CakeSession', '__write'),
    array('CakeSession', '__destroy'),
    array('CakeSession', '__gc')
);