Recommend this page to a friend! |
Download .zip |
Info | Example | View files (3) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-01-09 (4 days ago) | Not yet rated by the users | Total: 136 This week: 2 | All time: 9,232 This week: 204 |
Version | License | PHP version | Categories | |||
jlaso-my-session 1.0.10 | MIT/X Consortium ... | 5.2 | PHP 5, Files and Folders, User Manage... |
Description | Author | |
This class can store and get additional session data in files. |
<?php |
This is a complement of session files.
When you start an activity through ajax request and you want to get info of this activity via ajax, the subsequents requests are blocked waiting for the termination of the first request.
You need to stop using php's session file to serve more ajax request.
Sample of use:
<?php
if (isset($_REQUEST['sid'])) session_id($_REQUEST['sid']);
session_start();
// MySession
require '../MySession/MySession.php';
$mysession = new MySession(session_id());
$id = isset($_REQUEST['id'])?$_REQUEST['id']:'';
// this sends to requester the percent of activiy and id,
// normally the requester is a javascript routine and for not
// use global id vars now this script returns id
print(json_encode(array(
"p" => $mysession->readKey($id),
"id" => $id,
)));
?>
This file is that starts the activity and controls the percentage of activity, sample:
<?php
function process_demo(){
// ..code..
$mysession = new MySession( session_id() );
$app->contentType("text/html");
$mysession->writeKey($id, 0);
// relase php session for calls from requester stay attended
session_write_close();
// .. code that process long time ..
// indicates that finishes the long action
$mysession->writeKey($id, "OK");
die();
}
?>
In index.php bootstrap in SlimFramework project add:
// MySession require './app/others/MySession/MySession.php';
Files |
File | Role | Description |
---|---|---|
MySession.php | Class | Class source |
README.MD | Doc. | Documentation |
status.sample.php | Example | Example script |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.