WPIntell

Source evidence

What I am doing wrong here ? Not working.

Simple Session Support · support · 2013-04-25T11:51:00+00:00

complaintsentiment
mediumseverity
0.87relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

2 / 31 rows with source links

6.5% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
JeremyCh unresolved
So I started my header.php with: $lang = $_GET['lang']; if ($lang == 'FR' || $lang == 'EN') { simpleSessionSet('lang', $lang); } and below, I added: <ul> <li><a href="<?php echo home_url(); ?>?lang=FR">FR</a></li> <li><a href="<?php echo home_url(); ?>?lang=EN">EN</a></li> </ul> $siteLang = simpleSessionGet('lang', 'FR'); echo 'Session lang = '. $siteLang; Now irrespective of whatever link I click, my $siteLang is getting echoed as FR. Any idea ? http://wordpress.org/extend/plugins/simple-session-support/ It appears that the session value is not being set. Use a default in the simpleSessionGet that isn’t either ‘EN’ or ‘FR’. In the setting code add a line to set the value if the language is unknown, and see if that is set. That way you can tell where the error is. It’s also possible that sessions are not working properly, the most common cause is cookies not enabled, also read my post http://devondev.com/2012/02/03/using-the-php-session-in-wordpress/ for more details on how sessions work.

Comments

1 shown
Peter Wooster 2013-12-16T20:33:00+00:00

It appears that the session value is not being set. Use a default in the simpleSessionGet that isn’t either ‘EN’ or ‘FR’. In the setting code add a line to set the value if the language is unknown, and see if that is set. That way you can tell where the error is. It’s also possible that sessions are not working properly, the most common cause is cookies not enabled, also read my post http://devondev.com/2012/02/03/using-the-php-session-in-wordpress/ for more details on how sessions work.