Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 335231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:07:46+00:00 2026-05-12T10:07:46+00:00

Why cant I change cookie? If you chose a language you cant change. You

  • 0

Why cant I change cookie?

If you chose a language you cant change. You have to empty your cookies if you want to change language. Why is that?

if (isset($_GET['setLang']) && $_GET['setLang'] == 'en' 
|| isset($_COOKIE['setLang']) && $_COOKIE['setLang'] == 'en') {
setcookie("setLang", 'en', time()+(3600*12)); //expires in 12 hours
include('language/en/common.php');
}


elseif (isset($_GET['setLang']) && $_GET['setLang'] == 'se' 
|| isset($_COOKIE['setLang']) && $_COOKIE['setLang'] == 'se') {
setcookie("setLang", 'se', time()+(3600*12)); //expires in 12 hours
include('language/se/common.php');
}

else if (isset($_GET['setLang']) && $_GET['setLang'] == 'fr' 
|| isset($_COOKIE['setLang']) && $_COOKIE['setLang'] == 'fr') {
setcookie("setLang", 'fr', time()+(3600*12)); //expires in 12 hours
include('language/fr/common.php');
}

// default language is english
else {
  include('language/en/common.php');
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:07:47+00:00Added an answer on May 12, 2026 at 10:07 am

    You certainly can change cookies. You can’t change languages using the logic you have there because the way you’ve written it, an existing setting in $_COOKIE will always override a setting in $_GET (except for en, where $_GET will be checked first, so right now you should be able to switch to en if you started with another language). You need to do all checks against $_GET first, then all checks against $_COOKIE, if you want to be able to change languages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class which I cant change (SuperClass) that has an interface for
I have xsd schema file which I can't change. Here is an excerpt that
I have a cookie that is formatted like partA:partB . The colon is not
i cant change date value to the format which i want.This is my code.When
I have a problem that I cant seem to find a solution to, even
I cant Uninstall/change windows phone 7.1 sdk. It has allready installed in my system.
I want to change the UILabel text color but I can't change the color,
I have the following html structure (which is generated and I can't change): <table
i have the following xml. legacy: xml (can't change because it is externalize). <bean
I have a legacy table, which I can't change. The values in it can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.