I have a Cookie named "language" which has the language code which my website would load in .
How can i check if it's set and add it as the first segment in my url , and set it if it's not set .
For example redirect www.example.com to www.example.com/en/ if the cookie is not set and to www.example.com/ar/ if the cookie is set to "ar"