File tree Expand file tree Collapse file tree
webview-compose/src/commonMain/kotlin/io/github/kdroidfilter/webview/cookie Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,18 +21,18 @@ data class Cookie(
2121 STRICT ,
2222 }
2323
24- override fun toString (): String {
25- var cookieValue = " $name = $value "
26-
27- if (path != null ) cookieValue + = " ; Path=$path "
28- if ( domain != null ) cookieValue + = " ; Domain= $domain "
29- if (expiresDate != null ) cookieValue + = " ; Expires= " + getCookieExpirationDate(expiresDate )
30- if (maxAge != null ) cookieValue + = " ; Max-Age= $maxAge "
31- if (isSecure == true ) cookieValue + = " ; Secure "
32- if (isHttpOnly == true ) cookieValue + = " ; HttpOnly "
33- if (sameSite != null ) cookieValue + = " ; SameSite= $sameSite "
34-
35- return " $cookieValue ; "
24+ // Without buildString is empty in wasmJs
25+ override fun toString (): String = buildString {
26+ append( " $name = $value " )
27+ if (path != null ) append( " ; Path=$path " )
28+ // The domain must match the domain of the JavaScript origin. Setting cookies to foreign domains will be silently ignored.
29+ if (domain != null ) append( " ; Domain= $domain " )
30+ if (expiresDate != null ) append( " ; Expires= " + getCookieExpirationDate(expiresDate))
31+ if (maxAge != null ) append( " ; Max-Age= $maxAge " )
32+ if (isSecure == true ) append( " ; Secure " )
33+ if (isHttpOnly == true ) append( " ; HttpOnly " )
34+ if (sameSite != null ) append( " ; SameSite= $sameSite " )
35+ append( ' ; ' )
3636 }
3737}
3838
You can’t perform that action at this time.
0 commit comments