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

Clear cookies #21

Open
osanwe opened this issue Oct 12, 2015 · 0 comments
Open

Clear cookies #21

osanwe opened this issue Oct 12, 2015 · 0 comments

Comments

@osanwe
Copy link
Owner

osanwe commented Oct 12, 2015

Need to clear cookies after login like here for make user login data private.

/* Return codes:
 * 0 - success
 * 1 - cache doesn't exist
 * -1 - cannot delete cache
 * -2 - failed to find cache directory
 */
int Tools::clearCookies() {
    QStringList dataPaths = QStandardPaths::standardLocations(QStandardPaths::DataLocation);
    if(dataPaths.size()) {
        QDir webData(QDir(dataPaths.at(0)).filePath(".QtWebKit"));
        if(webData.exists()) {
            if(webData.removeRecursively())
                return 0;
            else
                return -1;
        }
        else
            return 1;
    }
    return -2;
}
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

No branches or pull requests

1 participant