Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-01-09 (9 months ago) | Not enough user ratings | Total: 140 | All time: 9,211 This week: 87 |
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 (3) |
File | Role | Description |
---|---|---|
MySession.php | Class | Class source |
README.MD | Doc. | Documentation |
status.sample.php | Example | Example script |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
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.