I\'m creating a bilingual site and have decided to use session_start to determine the language of the page using the following:
session_start();
I found an interesting article by Peter here. I'm using the following code in my functions.php:
add_action('init', 'myStartSession', 1);
add_action('wp_logout', 'myEndSession');
add_action('wp_login', 'myEndSession');
function myStartSession() {
if(!session_id()) {
session_start();
}
}
function myEndSession() {
session_destroy ();
}
This destroys old session when user logs out then in again with different account.