This topic is locked
[SOLVED]

 Session Language

10/2/2014 9:51:19 AM
PHPRunner General questions
C
cyberslugg author

I have a database running two languages, french and english. I am having an issue with the session language setting at log in.
English is the default display. If an english person comes on to the log in page, it is already in english, so they sign in and move on... however the language variable is not set. We are using this as per http://xlinesoft.com/phprunner/docs/localizing_phprunner_application.htm#transl_data
with out the session language being set none of the text appears, just the numeric codes.
Right now I have to manually flip the language to french then back to english after log in to have the session language set.
Am I missing something, perhaps an extra coding, at the log in page that will set and pass the session language properly so these variable fields will display properly?
Thanks

C
cyberslugg author 10/3/2014

After finding this http://www.asprunner.com/forums/topic/17008-sessionlanguage-by-default-empty/
I used a reference from there and put
$_SESSION["language"] = mlang_getcurrentlang();
In the Before Process section of one of the first page loads. This successfully sets the session language so that the multilanguage tables see a session language value and all work properly
thanks

Admin 10/4/2014

My guess is that that session variable is not set unless you switch the language from default one.

C
cyberslugg author 10/4/2014

Thanks Sergey, that is what I suspected and after trying a lot of things, I found just forcing it this way worked. Setting it in the "Before Process" event of the lander page ensures that it is set for the rest of the session.