[eluser]Unknown[/eluser]
Ajax does not exhibit this issue. I have been able to cut down the session regeneration from infinite to 2.
Example code for views/sandbox/dispatcher:
Code:
<div id="sandbox_dispatcher">
<div class="content">
<div class="header">
<h1>Sandbox > Dispatcher</h1>
<p>Attempting to port over a dispatcher from CakePHP that does not interrupt sessions.</p>
</div>
<div class="content">
<div id="dispatcher_test">
<h3>Dispatcher Test</h3>
<?
$headers = array();
foreach(getallheaders() as $key=>$value) {
$headers[] = $key.': '.$value;
}
?>
<div id="dispatch_curl">
<h5>Dispatch to another controller using cURL</h5>
<?
// This doesnt work because it keeps affecting the session table
$curl = curl_init(base_url().'sandbox/dispatcher_target/');
curl_setopt_array($curl, array(
CURLOPT_HTTPHEADER => $headers,
CURLOPT_HEADER => 0,
CURLOPT_USERAGENT => $this->session->userdata['user_agent']
));
curl_exec($curl);
?>
</div>
<div id="dispatch_ajax">
<h5>Dispatch to another controller using AJAX</h5>
<div class="ajax_resp">
</div>
</div>
</div>
<div id="current_sessions">
<h3>Current Sessions</h3>
<? pr($sessions) ?>
<ul>
</ul>
</div>
</div>
</div>
</div>
[removed]
window.addEvent('domready', function() {
new Request({url: leafm.globals.BASE_URL + 'sandbox/dispatcher_target'})
.addEvent('complete', function(resp) {
$('dispatch_ajax').getElement('div.ajax_resp').set('html', resp);
})
.send();
});
[removed]