TargetPathTrait
Trait to get (and set) the URL the user last visited before being forced to authenticate.
Table of Contents
Methods
- getTargetPath() : string|null
- Returns the URL (if any) the user visited that forced them to login.
- removeTargetPath() : mixed
- Removes the target path from the session.
- saveTargetPath() : mixed
- Sets the target path the user should be redirected to after authentication.
Methods
getTargetPath()
Returns the URL (if any) the user visited that forced them to login.
private
getTargetPath(SessionInterface $session, string $firewallName) : string|null
Parameters
- $session : SessionInterface
- $firewallName : string
Return values
string|nullremoveTargetPath()
Removes the target path from the session.
private
removeTargetPath(SessionInterface $session, string $firewallName) : mixed
Parameters
- $session : SessionInterface
- $firewallName : string
saveTargetPath()
Sets the target path the user should be redirected to after authentication.
private
saveTargetPath(SessionInterface $session, string $firewallName, string $uri) : mixed
Usually, you do not need to set this directly.
Parameters
- $session : SessionInterface
- $firewallName : string
- $uri : string