session_start seems to be very slow (but only sometimes)
Have you tried session_write_close();
?
This will disable write-ability in session variables but you can still read data from them. And later when you need to write a session variable, reopen it.
I have also suffered from this problem but this thing worked like a charm. This is what i do:
session_start(); //starts the session
$_SESSION['user']="Me";
session_write_close(); // close write capability
echo $_SESSION['user']; // you can still access it
Zend_Session::Start intolerably slow (but only sometimes)
Take a look at your session garbage collection mechanism (play with probability and divisor).
If gc is slowing down the app, consider cleaning the old sessions manually (e.g. setting gc probability to 1 and running gc script via cron).
Another possibilities:
- session mechanism is locked (so the app waits to unlock, then write)
- too much data saved
Problem with function session_start() (works slowly)
The file containing the session's informations is locked during the time PHP serves a request.
So, if you have one PHP script (using a session) that's currently being executed, and the same user sends another request, the second request will wait until the first is finished.
session_start() takes long time and makes pages pending
Solution: session_write_close(); and PHP Session Lockes
<?php
// First File
if(session_id() == '')
session_start();
session_write_close();
sleep(10);
session_start() makes site unreachable
I fixed my problem by completly uninstalling my xampp version and reinstalling the latest one. What I still dont know is why that error appeared in the first place.
Related Topics
Check and Return Duplicates Array PHP
Unchecked Checkbox Returning Null Value
Jquery Ajax Form Data Serialize Using PHP
Programmatically Create Image from Web-Page or a Single Div
Phpstorm: How to Add Method Stubs from a Pecl Library That PHPstorm Doesn't Currently Support
PHP Code Inside a Laravel 5 Blade Template
Codeigniter 4 Problem Installing with Composer
How to Remove All Dtddwrappers and Labels on Zend Form Elements
How to Prevent PHP Script Running More Than Once
How to Convert Arabic Characters to Unicode Using PHP
Pdo_Sqlite Driver Not Present.. What to Do
Regex to Conditionally Replace Twitter Hashtags with Hyperlinks
How to Use Session Variables in Wordpress
How to Resize and Convert an Uploaded Image to a Png Using Gd
Php, How to Get Current Date in Certain Format
How to Wrap Text Using Imagick in PHP So That It Is Drawn as Multiline Text