File tree 2 files changed +8
-6
lines changed
backend/app/Services/Infrastructure/Session
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 23
23
[ ![ X (formerly Twitter) Follow] ( https://img.shields.io/twitter/follow/HiEventsTickets )] ( https://x.com/HiEventsTickets )
24
24
<br />
25
25
[ ![ Hi.Events docs] ( https://img.shields.io/badge/docs-hi.events-blue )] ( https://hi.events/docs )
26
- [ ![ License: AGPL v3] ( https://img.shields.io/badge/License-AGPL_v3-blue.svg )] ( https://github.com/HiEventsDev/hi.events /LICENCE )
26
+ [ ![ License: AGPL v3] ( https://img.shields.io/badge/License-AGPL_v3-blue.svg )] ( https://github.com/HiEventsDev/Hi.Events/blob/develop /LICENCE )
27
27
[ ![ GitHub Release] ( https://img.shields.io/github/v/release/HiEventsDev/hi.events?include_prereleases )] ( https://github.com/HiEventsDev/hi.events/releases )
28
28
[ ![ Run Unit Tests] ( https://github.com/HiEventsDev/hi.events/actions/workflows/unit-tests.yml/badge.svg?event=push )] ( https://github.com/HiEventsDev/hi.events/actions/workflows/unit-tests.yml )
29
29
[ ![ Docker Pulls] ( https://img.shields.io/docker/pulls/daveearley/hi.events-all-in-one )] ( https://hub.docker.com/r/daveearley/hi.events-all-in-one )
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ class CheckoutSessionManagementService
11
11
{
12
12
private const SESSION_IDENTIFIER = 'session_identifier ' ;
13
13
14
+ private ?string $ sessionId = null ;
15
+
14
16
public function __construct (
15
17
private readonly Request $ request ,
16
18
)
@@ -22,13 +24,13 @@ public function __construct(
22
24
*/
23
25
public function getSessionId (): string
24
26
{
25
- $ sessionId = $ this ->request ->cookie (self ::SESSION_IDENTIFIER );
26
-
27
- if (!$ sessionId ) {
28
- $ sessionId = $ this ->createSessionId ();
27
+ if ($ this ->sessionId ) {
28
+ return $ this ->sessionId ;
29
29
}
30
30
31
- return $ sessionId ;
31
+ $ this ->sessionId = $ this ->request ->cookie (self ::SESSION_IDENTIFIER ) ?? $ this ->createSessionId ();
32
+
33
+ return $ this ->sessionId ;
32
34
}
33
35
34
36
public function verifySession (string $ identifier ): bool
You can’t perform that action at this time.
0 commit comments