-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add keyword to get all cookie information #932
Comments
I add this into SL 3.0 rc 1 scope because some kind of a way to get the expiry value would be needed by #891. If adding a new object and deprecations it would require is too much work, we can in SL 3.0 simply enhance the existing |
I think that option 2 would be best but it might be challenging to do in the 3.0 scope. Then doing the option 1 would be nice. |
One thing to decide, regardless how we decide to return the information, is how to represent the expiry time. Apparently browsers store them in seconds (since EPOCH?) except for Safari that uses milliseconds. We should always use the same format, regardless the browser, and I don't think a plain integer (or float) is the best representation. Probably the best idea would be using Python's standard datetime object. They have useful attributes that can be accessed in data like |
I don't have knowledge how the expiry date of the cookie is stored. Is it possible that other formats than epoch is supported? By quickly googling it looks like that: https://stackoverflow.com/questions/6556930/python-persistent-cookie-generate-expires-field and |
Done in #930 |
Attributes provided by the returned object should be documented. Using a table for attributes and adding some usage examples similarly as with Process library's Result object ought to work well. Should also add a note that this keyword was added in SL 3.0. |
We currently have
Get Cookie Value
but it only returns the value, not other information such as expiry. We have few possibilities how this could be implemented:Enhance the existing
Get Cookie Value
to allow returning other info too. For backwards compatibility reasons its default behavior cannot change, but it could get a new optional argument likeinfo='value'
that could be used like this:Add separate new keyword like
Get Cookie
orGet Cookie Information
that returns a custom object containing all cookie information in its attributes. This info could then be used in the data easily:Enhance the existing
Get Cookie Value
to return an object with all the cookie information.My favorite is option 2. If we decide to do that, then we could consider deprecating the existing
Get Cookie Value
. We should also think what to do with the currentGet Cookies
which returns a string in formatcookie1=value1; cookie2=value2
. It should rather return a list of cookie objects, but that change would be backwards incompatible. I have an idea how it could be deprecated pretty gracefully, though.The text was updated successfully, but these errors were encountered: