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

SPID - Riprovare (Second try login ) #43

Open
amdounio opened this issue Nov 4, 2022 · 1 comment
Open

SPID - Riprovare (Second try login ) #43

amdounio opened this issue Nov 4, 2022 · 1 comment

Comments

@amdounio
Copy link

amdounio commented Nov 4, 2022

    Hello , 

Thanks you for this plugin , but i have the same problem , i login via spid in the second try

"SPID - Riprovare" in the first try ,

Originally posted by @amdounio in #34 (comment)

@unixforce
Copy link

unixforce commented Jan 11, 2023

@amdounio The problem was due on cookie PHPSESSID destroyed by some browser (Google Chrome/ Microsoft Edge) on cross domain requests.

To prevent this issue I've modified the session_start() call on plugin hook 'init' on this way with 3 options:

if ( session_status() == PHP_SESSION_NONE ) {
     session_set_cookie_params(['samesite' => 'None']); 
     session_start(['cookie_secure' => true,'cookie_httponly' => true]);
}

And wp-spid-italia.php:

if ( isset( $_GET['spid_idp'] ) && $_GET['spid_idp'] != '' ) {
            if ( $sp->isAuthenticated() ) {

                        unset($_SESSION['RequestID']);
		        unset($_SESSION['idpName']);
		        unset($_SESSION['idpEntityId']);
		        unset($_SESSION['acsUrl']);
		        unset($_SESSION['spidSession']['idp']);
		        unset($_SESSION['spidSession']);
		        
		        unset($_SESSION['inResponseTo']);
		        unset($_SESSION['spid_redirect_to']);
		        unset($_SESSION['sloUrl']);

           }
}

This code will fix the issue. I Hope this help you !

Regards
Nunzio

sviluppoRobyone pushed a commit to robyone-srl/wp-spid-italia that referenced this issue Dec 22, 2023
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

2 participants