Skip to content

Commit

Permalink
Move cookieStrategy description to type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
fluiddot committed Sep 12, 2024
1 parent 364e7de commit 3ab3876
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 27 deletions.
27 changes: 16 additions & 11 deletions packages/php-wasm/universal/src/lib/php-request-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ export type FileNotFoundGetActionCallback = (
relativePath: string
) => FileNotFoundAction;

/**
* - `internal-store`: Persist cookies from reponses in an internal store and
* includes them in following requests. This behavior is useful in the Playground
* web app because it allows multiple sites to set cookies on the same domain
* without running into conflicts. Each site gets a separate "namespace". The
* downside is that all cookies are global and you cannot have two users
* simultaneously logged in.
*
* - `pass-through`: Typical server behavior. All cookies are passed back to the
* client via a HTTP response. This behavior is useful when Playground is running
* on the backend and can be requested by multiple browsers. This enables each
* browser to get its own cookies, which means two users may be simultaneously
* logged in to their accounts.
*
* Default value is `internal-store`.
*/
export type CookieStrategy = 'internal-store' | 'pass-through';

interface BaseConfiguration {
Expand Down Expand Up @@ -98,17 +114,6 @@ export type PHPRequestHandlerConfiguration = BaseConfiguration &
maxPhpInstances?: number;
}
) & {
/**
* - `internal-store`: Persist cookies from reponses in an internal store and
* includen them in following requests. This is a behavior mostly needed when
* using Playground in web.
*
* - `pass-through`: Avoid persisting cookies internally and let them pass
* through the requests and back to the caller from responses. This is the
* common behavior in requests handled by a server.
*
* Default value is `internal-store`.
*/
cookieStrategy?: CookieStrategy;
};

Expand Down
16 changes: 0 additions & 16 deletions packages/playground/wordpress/src/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,6 @@ export interface BootOptions {
*/
getFileNotFoundAction?: FileNotFoundGetActionCallback;

/**
* - `internal-store`: Persist cookies from reponses in an internal store and
* includes them in following requests. This behavior is useful in the Playground
* web app because it allows multiple sites to set cookies on the same domain
* without running into conflicts. Each site gets a separate "namespace". The
* downside is that all cookies are global and you cannot have two users
* simultaneously logged in.
*
* - `pass-through`: Typical server behavior. All cookies are passed back to the
* client via a HTTP response. This behavior is useful in when Playground is
* running on the backend and can be requested by multiple browsers. This enables
* each browser to get its own cookies, which means two users may be simultaneously
* logged in to their accounts.
*
* Default value is `internal-store`.
*/
cookieStrategy?: CookieStrategy;
}

Expand Down

0 comments on commit 3ab3876

Please sign in to comment.