File tree 1 file changed +4
-15
lines changed
1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -103,21 +103,10 @@ public function start(): void
103
103
session_id ($ id ); // causes resend of a cookie to make sure it has the right parameters
104
104
}
105
105
106
- try {
107
- // session_start returns false on failure only sometimes
108
- Nette \Utils \Callback::invokeSafe (
109
- 'session_start ' ,
110
- [['read_and_close ' => $ this ->readAndClose ]],
111
- function (string $ message ) use (&$ e ): void {
112
- $ e = new Nette \InvalidStateException ($ message );
113
- }
114
- );
115
- } catch (\Throwable $ e ) {
116
- }
117
-
118
- if ($ e ) {
119
- @session_write_close (); // this is needed
120
- throw $ e ;
106
+ if (!@session_start (['read_and_close ' => $ this ->readAndClose ])) { // @ is escalated to exception
107
+ $ message = Nette \Utils \Helpers::getLastError ();
108
+ @session_write_close (); // this is needed?
109
+ throw new Nette \InvalidStateException ($ message );
121
110
}
122
111
123
112
$ this ->initialize ();
You can’t perform that action at this time.
0 commit comments