Skip to content

Cloudfront sign cookie expire time not update #2861

Closed
@deepenpatel19

Description

@deepenpatel19

Acknowledgements

Describe the bug

Usually, we decide when to set cookie expire. So, we are passing expire time in cookie policy statement. But, it's not updating in cookie when generated.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

It should be set expire what we pass in policy statement or cookie options.

Current Behavior

At this moment, it's giving default time.

Reproduction Steps

awsEpochTime := sign.NewAWSEpochTime(expireTimeNew)
	customStatement := sign.Statement{
		Resource: "https://*.<domain>/media/*",
		Condition: sign.Condition{
			DateLessThan: awsEpochTime,
		},
	}
	customPolicy := sign.Policy{
		Statements: []sign.Statement{
			customStatement,
		},
	}

	signedCookies, err := cookieSigner.SignWithPolicy(&customPolicy, func(co *sign.CookieOptions) {
		co.Path = "/"
		co.Domain = ".<domain>"
		co.Secure = true
	})

Here, we are passing date less than for expiry. But, it's not set expiry time in cookie.

Possible Solution

May be we can pass expire in cookie option or pick from policy statement while generating cookie.

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2 v1.30.1
github.com/aws/aws-sdk-go-v2/config v1.27.11
github.com/aws/aws-sdk-go-v2/credentials v1.17.11
github.com/aws/aws-sdk-go-v2/service/rekognition v1.43.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1
github.com/aws/aws-sdk-go-v2/service/sqs v1.32.6

Compiler and Version used

1.23.1

Operating System and version

Mac

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions