Set PodeCookie - mdaneri/Pode GitHub Wiki
Sets a cookie on the Response.
Set-PodeCookie -Name <String> [-Value <String>] [-Secret <String>] [-Duration <Int32>] [-HttpOnly] [-Discard]
[-Secure] [-Strict] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Set-PodeCookie -Name <String> [-Value <String>] [-Secret <String>] [-ExpiryDate <DateTime>] [-HttpOnly]
[-Discard] [-Secure] [-Strict] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Sets a cookie on the Response using the "Set-Cookie" header. You can also set cookies to expire, or being signed.
Set-PodeCookie -Name 'Views' -Value 2
Set-PodeCookie -Name 'Views' -Value 2 -Secret 'hunter2'
Set-PodeCookie -Name 'Views' -Value 2 -Duration 3600
Inform browsers to remove the cookie.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe duration, in seconds, before the cookie is expired.
Type: Int32
Parameter Sets: Duration
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseAn explicit expiry date for the cookie.
Type: DateTime
Parameter Sets: ExpiryDate
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOnly allow the cookie to be used in browsers.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe name of the cookie.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the secret with which to sign the cookie.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOnly allow the cookie on secure (HTTPS) connections.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the Secret will be extended using the client request's UserAgent and RemoteIPAddress.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe value of the cookie.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.