File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,21 +97,10 @@ public function start(): void
9797 session_id ($ id ); // causes resend of a cookie to make sure it has the right parameters
9898 }
9999
100- try {
101- // session_start returns false on failure only sometimes
102- Nette \Utils \Callback::invokeSafe (
103- 'session_start ' ,
104- [['read_and_close ' => $ this ->readAndClose ]],
105- function (string $ message ) use (&$ e ): void {
106- $ e = new Nette \InvalidStateException ($ message );
107- }
108- );
109- } catch (\Throwable $ e ) {
110- }
111-
112- if ($ e ) {
100+ if (!@session_start (['read_and_close ' => $ this ->readAndClose ])) { // @ is escalated to exception
101+ $ message = Nette \Utils \Helpers::getLastError ();
113102 @session_write_close (); // this is needed
114- throw $ e ;
103+ throw new Nette \ InvalidStateException ( $ message ) ;
115104 }
116105
117106 $ this ->initialize ();
You can’t perform that action at this time.
0 commit comments