-1

I have a bug that I can not identify, in my php script I made a session_start() begin in my file. but I do not understand why in some cases session_start() does not work and I could not return the server, but I have no errors from PHP. I have read this link session_start() takes VERY LONG TIME and I have try to add session_write_close() but I still have the problem sometimes. I really do not look have you any ideas?

Maybe session.gc_probability = 0 can help me ?

Code :

<?php
     session_start();
     echo "test";
?>
Community
  • 1
  • 1
Simon
  • 23
  • 5
  • 2
    Define "does not work". In what way does it fail? Can you show sample code which demonstrates the problem? – David Mar 03 '16 at 13:37
  • No I have no error from php, in my `index.php` first line I have `session_start()` and somtimes `session_start()` don't work, I close my browser I re opened and it works @David – Simon Mar 03 '16 at 13:40
  • "don't work" isn't exactly a clarification of "does not work". You have to actually describe the problem. Nobody can answer "it doesn't work". – David Mar 03 '16 at 13:41
  • How you catch and decide that `session_start()` does not work? Missing session info or what? – mitkosoft Mar 03 '16 at 13:47
  • If you paste a chunk of your code in here, we can help. Without seeing everything, we can't see what you are doing/possibly doing wrong. – Son Mar 03 '16 at 13:48
  • Because after `session_start()` I have `echo "test` and Somtimes my `echo` never show @mitkosoft – Simon Mar 03 '16 at 13:48
  • Do you have error_reporting = on? – Keyne Viana Mar 03 '16 at 13:55
  • Yes I have `error_reporting = on` @Keyne Viana – Simon Mar 03 '16 at 13:56
  • But it should show you an error, try http://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display – Keyne Viana Mar 03 '16 at 13:58

1 Answers1

0

Try to put after start_session()

echo "SID1: ".SID."<br>session_id(): ".session_id()."<br>COOKIE: ".$_COOKIE["PHPSESSID"];
bars38
  • 21
  • 1