Skip to content

Commit d9e8c0d

Browse files
authoredSep 15, 2024··
Merge pull request #229 from HiEventsDev/develop
2 parents 4d52f34 + 1b84773 commit d9e8c0d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/HiEventsTickets)](https://x.com/HiEventsTickets)
2424
<br/>
2525
[![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)
2727
[![GitHub Release](https://img.shields.io/github/v/release/HiEventsDev/hi.events?include_prereleases)](https://github.com/HiEventsDev/hi.events/releases)
2828
[![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)
2929
[![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)

‎backend/app/Services/Infrastructure/Session/CheckoutSessionManagementService.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ class CheckoutSessionManagementService
1111
{
1212
private const SESSION_IDENTIFIER = 'session_identifier';
1313

14+
private ?string $sessionId = null;
15+
1416
public function __construct(
1517
private readonly Request $request,
1618
)
@@ -22,13 +24,13 @@ public function __construct(
2224
*/
2325
public function getSessionId(): string
2426
{
25-
$sessionId = $this->request->cookie(self::SESSION_IDENTIFIER);
26-
27-
if (!$sessionId) {
28-
$sessionId = $this->createSessionId();
27+
if ($this->sessionId) {
28+
return $this->sessionId;
2929
}
3030

31-
return $sessionId;
31+
$this->sessionId = $this->request->cookie(self::SESSION_IDENTIFIER) ?? $this->createSessionId();
32+
33+
return $this->sessionId;
3234
}
3335

3436
public function verifySession(string $identifier): bool

0 commit comments

Comments
 (0)
Please sign in to comment.