Jump to content

Language session


fisnik
 Share

Recommended Posts

I am using processwire with multi language. I have set up multi language and it is working perfect. What i need is that when a user chooses a language when he visits  web for the first time to be remembered like a session or cookie next time when he visit that web. I have searched in forum but couldn't find anything. Ant help would be appreciated. Thank you

Link to comment
Share on other sites

Hello @fisnik,

have a look at the $session variable:

https://processwire.com/api/variables/session/
https://processwire.com/api/ref/session/

It works similar to a cookie, but lasts only as long as the browser is opened, as far as I know. ;)

If you want to save the cookie for a longer duration, I can recommend using JavaScript Cookie.

Regards, Andreas

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...