Skip to content
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

Update Android Cookie Expiration date format to 24-hour format (HH) #2389

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

takuyaaaaaaahaaaaaa
Copy link
Contributor

@takuyaaaaaaahaaaaaa takuyaaaaaaahaaaaaa commented Oct 31, 2024

Summary

This PR modifies the method for formatting cookie expiration dates in the Android part of the flutter_inappwebview library. Specifically, it changes the time format from hh (12-hour format) to HH (24-hour format).

Changes

  • Updated the getCookieExpirationDate method on Android to change the SimpleDateFormat pattern from "EEE, dd MMM yyyy hh:mm:ss z" to "EEE, dd MMM yyyy HH:mm:ss z".

Background

It was observed that cookies were correctly saved in the morning, but during late night hours, while iOS stored cookies normally, Android had issues with saving them. After investigation, it was determined that the use of the 12-hour format (hh) was the root cause of this behavior.

Connection with issue(s)

Resolve issue #1778

Connected to #1778

Testing and Review Notes

Please verify the following between 13:00 and 23:00 UTC:

  1. Build the app on an Android device, launch the WebView, and check that cookies are set correctly.
  2. Perform the same check on an iOS device (regression test).

The testing was done using the sample app, where cookies were retrieved and logged for verification. The sample app can be found here:
https://github.com/takuyaaaaaaahaaaaaa/FlutterWebViewSample

Screenshots or Videos

flutter-version:3.24.4
Android: Pixel8 API35 ※simulator
iOS: iPhone16Pro iOS18.1 ※simulator

Android

Before

image

After

image

iOS

Before

image

After

image

To Do

  • double check the original issue to confirm it is fully satisfied
  • add testing notes and screenshots in PR description to help guide reviewers
  • request the "UX" team perform a design review (if/when applicable)

- changed SimpleDateFormat patter from 'hh'(12-hour) to 'HH'(24-hour)
@takuyaaaaaaahaaaaaa takuyaaaaaaahaaaaaa marked this pull request as ready for review October 31, 2024 18:50
@pichillilorenzo
Copy link
Owner

Thanks! Didn't expect to miss this!

@pichillilorenzo pichillilorenzo merged commit 0db3491 into pichillilorenzo:master Nov 4, 2024
@pichillilorenzo
Copy link
Owner

@all-contributors please add @takuyaaaaaaahaaaaaa for code

Copy link
Contributor

@pichillilorenzo

I've put up a pull request to add @takuyaaaaaaahaaaaaa! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants