Android Question [AdvancedWebview] how can i clear cookies ? ( logout dont works )

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
When I try to log out of my site, it doesn't work because cookies remain, is there any way to clear them?

B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
    #BridgeLogger:    true   
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private advWV As AdvancedWebView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")
    advWV.CookiesEnabled = False
    advWV.GeolocationEnabled = True
    advWV.loadUrl("https://my url.com")
End Sub

Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub AdvWv_onDownloadRequested(url As String, suggestedFilename As String, mimeType As String, contentLength As Long, contentDisposition As String, userAgent As String)
    Log($"AdvWv_onDownloadRequested(
    ${url},
    ${suggestedFilename},
    ${mimeType},
    ${contentLength},
    ${contentDisposition},
    ${userAgent})"$)
    Log("Download saved successfully: "&advWV.handleDownload(url,suggestedFilename))
End Sub
Sub AdvWv_onExternalPageRequest(url As String)
    Log($"AdvWv_onExternalPageRequest(${url})"$)
End Sub
Sub AdvWv_onPageError(errorCode As Int, description As String, failingUrl As String)
    Log($"AdvWv_onPageError(${errorCode},${description},${failingUrl})"$)
  
End Sub
Sub AdvWv_onPageFinished(url As String)
    Log($"AdvWv_onPagefinished(${url})"$)
  
    If (url.Contains("/user/logout/")) Then
      
    End If
  
End Sub
Sub AdvWv_onPageStarted(url As String, favIcon As Object)
    Log($"AdvWv_onPageStarted(${url})"$)
  
End Sub
 
Top