How Many Types of Website Cookies

There are three different types website cookies

  • Persistent(Permanent) Cookies : Once Cookie stored in small Text File in hard disk of the computer defined as Persistent(Permanent) Cookies
  • Non Persistent (Temporary) Cookies : Once Cookie stored in Browser’s Memory defined as Non Persistent(Temporary) or Per-Session Cookies or Session Cookies, These Cookies automatically discarded when the Web browser is closed.
  • Third-Party Cookies : Those are set by domains & not directly visited by the user. These cookies will be integrated by web advertisers, web publishers add third-party elements (if chatbot, social plugins, or advertisement etc) on the website.

How To Change Cookie Settings in Magento 2.x

Cookie Definition :

Once User enabled Cookies on a website, It stores user’s data (Username & Password as unique identifiers, preferred language or location) in Browser’s Memory or as small Text File, Client’s cookies interconnected server to transmit data, These stored information making shopping experience very wonderful, once user again visited store site.

How Many Types of Website Cookies

The Website Cookie Law and Regulations


There are following below steps need to follow Cookie Settings in Magento 2 Admin

[1]- Go To STORES > Configuration, redirects on configuration.

[2]- Left Panel Clicked on General > Web, redirects on [Right Panel]

[3]- Once redirection on [Right Panel]

[4]- Once clicked / expanded, Default Cookie Settings [Right Panel]

Each Input Field of Default Cookie Settings defined as

[4.1]- Cookie Lifetime : By Default It’s 3600 Second (1 Hour), In case customer Cookie Lifetime, need to put custom value (in seconds) as per store requirement.

[4.2]- Cookie Path : If admin want to keep cookies available to other folders, need to put forward slash to keep the cookies available anywhere on the site.

[4.3]- Cookie Domain : If admin want to enable cookies for some specific subdomain. Enter something like “.domain.com” to enable cookies for all the subdomains. Remember, put dot(.) before domain name.

[4.4]- Use HTTP Only : By Default selected Yes, to prevent scripting languages from gaining access to cookies.

General Data Protection Regulation (GDPR) and California Consumer Privacy Act (CCPA) require online merchants to make the process of collecting customer personal data secure, transparent, and with customer consent. To protect cookies from thefts, Admin should apply the HttpOnly attribute, which protects cookies from being accessed by JavaScript.

By default, Magento 2 examines whether HTTPS is enabled and sets a Security Flag automatically.

HttpOnly Attribute or Flag indicates, Always Use HTTP Only , select as Yes

Never try Use HTTP Only as select No as per Security Vulnerability Issue.

[4.5]- Cookie Restriction Mode : By Default selected No , to enable Cookie Restriction Mode, select Yes

Cookie Restriction Mode prevents web store from collecting cookies data of customers, so full-featured operations cannot be enabled. In this mode, customers have to confirm that website needs cookies to allow full-featured operations & making wonderful shopping experience “

[5]- Click on Save Config button & run CLI command Flush



How to Configure Default Page Layout Magento 2.x

Magento 2 design pages having collection of layouts, containers, blocks. headers, footers etc. each page having its own design set as per store requirement. Magento 2 Admin provides facility to change pages design set.

There are following below steps need to follow, Magento 2 Admin

[1]- Go To STORES > Configuration, redirects on configuration.

[2]- Left Panel Clicked on General > Web, redirects on [Right Panel]

[3]- Once redirection on [Right Panel]

[4]- Once clicked / expanded, Default Layouts [Right Panel]

Each Layout defined as

[4.1] Default Product Layout : This layout allow to select the layout option for the product pages

[4.2] Default Category Layout : This layout allow to select the layout option for the category pages

[4.3] Default Page Layout : This layout allow to select the layout option for the default pages

Each Drop Down Value of  Default Product Layout, Default Category Layout & Default Product Layout defined as below

[a]- No layout updates : Layout updates are not available for product or category pages.

[b]- Empty : Uses a blank layout for product or category pages.

[c]- 1 column : Uses a single column layout for product or category pages .

[d]- 2 columns with left bar : Uses a two-column layout with the sidebar on the left for category pages.

[e]- 2 columns with right bar : Uses a two-column layout with the sidebar on the right product or category pages.

[f]- 3 columns : Uses a three-column layout with sidebars on the left and right for product or category pages.

[5]- Finally click on Save Config Button

How To Configure the Default Page in Magento 2.x

Magento 2 default page, which is appeared as Home Page, once user typing URL & specified URL page found as “Page Not Found” error occurs, the default page will be displayed.


Finally, Magento 2 Home Page & Error Page “Page Not Found” defined as Default Pages.

There are following below steps to follow to configure Default Pages.

[1]- Go To STORES > Configuration, redirects on configuration.

[2]- Left Panel Clicked on General > Web, redirects on [Right Panel]

[3]- Once redirection on [Right Panel]

[4]- Once clicked / expanded, Default Pages [Right Panel]

Each Input Field of  Default Pages defined as below

[4.1]- Default Web URL : By Default cms or enter other value as per Store Requirement.

[4.2]- CMS Home Page : By Default Home Page selected or select other page from drop as per Store Requirement.

[4.3]- Default No-route URL : By Default “cms/index/noRoute” or enter other value as per Store Requirement.

[4.4]- CMS No Cookies Page : By Default “404 Page Not Found” selected or select other page from drop as per Store Requirement.

[4.5]- CMS No Cookies Page : By Default “Enable Cookies” selected or select other value from drop as per Store Requirement.

[4.6]- Show Breadcrumbs for CMS Pages : By Default “Yes” selected, if do not want display Breadcrumbs for CMS Pages, select No.

[5]- Finally click on Save Config Button

How To Change Base URLs in Magento 2.x By Database Query

There are following database SQL query need to run

To change the base URLs, run the following SQL Query:

update core_config_data set value = 'http://mage2db.com/' where path = 'web/unsecure/base_url';


To change the secure base URLs, run the following SQL Query:

update core_config_data set value = 'https://mage2db.com/' where path = 'web/secure/base_url';

How To Change Base URLs in Magento 2.x

There are following below steps need to follow.

[1]- Go To STORES > Configuration, redirects on configuration.

[2]- Left Panel Clicked on General > Web, redirects on [Right Panel].

[3]- Once redirection on [Right Panel]

[4]- Once clicked / expanded, Base URLs [Right Panel]

[4.1] After expanded Base URLs [Right Panel]

Each Input Field of Base URLs defined as below

[a]- Base URLs : Enter the unsecure (http) Base URL for your store. Make sure to end the URL with a forward slash (“/”).

[b]- Base Link URL : The placeholder link is available and used to create relative links to the base URL.

[c]- Base URL for Static View Files : Option Field, The alternate location for the base URL for static view files.

[d]- Base URL for User Media Files : Option Field, The alternate location for the base URL for Media files.

[4.2] After expanded Base URLs (Secure) [Right Panel]

Each Input Field of Secure Base URLs defined as below

[a]- Secure Base URLs : Enter the secure (https) Base URL for your store. Make sure to end the URL with a forward slash (“/”).

[b]- Secure Base Link URL : The placeholder link is available and used to create relative links to the base URL.

[c]- Secure Base URL for Static View Files : Option Field, The alternate location for the base URL for static view files.

[d]- Secure Base URL for User Media Files : Option Field, The alternate location for the base URL for Media files.

[e]- Use Secure URLs on Storefront : By Default No selected, if Admin want to run Secure Storefront URLs, need to select Yes

[f]- Use Secure URLs in Admin : By Default No selected , if Admin want to run Secure URLs in Admin, need to select Yes

[5]- Finally click on Save Config Button

How To Configure Search Engine Optimization in Magento 2.x

Search Engine Optimization display SEO or User Friendly URL, so that customers can easily ready shopping site pages URLs. These URLs are indexed by Search Engine.

There are following things need to do enable SEO

Magento 2 Admin

[1]- Go To STORES > Configuration, redirects on configuration.

[2]- Left Panel Clicked on General > Web, redirects on [Right Panel]

[3]- Once redirection on [Right Panel]

[4]- Once clicked / expanded, Search Engine Optimization [Right Panel]

Use Web Server Rewrites with Yes Selection

Use Web Server Rewrites By Default Yes selected.

[5]- Finally click on Save Config Button

How To Add Store Codes To The URLs in Magento 2.x

There are following below steps need to follow

[1]- Go To STORES > Configuration, redirects on configuration

[2]- Left Panel Clicked on General > Web, redirects on [Right Panel]

[3]- Once redirection on [Right Panel]

[4] -Once clicked / expanded, URL Options [Right Panel]

  • Add Store Code to Urls : It is strictly recommendation , always select No. By Default Selected No. Never try to select Yes, otherwise Application will be stopped.
  • Auto-redirect to Base URL : It represents Auto Redirection Website Application Base URL, normally these setting need to do .htaccess file of Website Application, but here Magento 2 provide Admin Setting to do.
  • There are three type redirection

No : Once selected No, There will no Redirection in Base URL.

Yes(302 Found) : Once selected Yes(302 Found), Base URL will b redirected from http://yoursite.com To http://www.yoursite.com

Yes (301 Moved Permanently) : Once selected Yes (301 Moved Permanently), indicates Permanent redirection from Base URL to another Base URL, Search Engines that page has moved that new page can be properly indexed,

Some Common of Yes (301 Moved Permanently)

  • After moving New Domain
  • After Moving old site pages to new site pages , so that users can view new site pages.

[5] – Finally click on Save Config Button

Magento 2.x Configuration General Web

Magento 2 General Web Configuration important terms, having collection following things

  • Url Options
  • Search Engine Optimization
  • Base URLs
  • Base URLs (Secure)
  • Default Pages
  • Default Layouts
  • Default Cookie Settings
  • Session Validation Settings
  • Browser Capabilities Detection