MAC Cookie is a newly introduced Hotspot feature in MikroTik Router. MAC Cookie is specially designed to improve accessibility for smartphones, laptop and other mobile devices. MAC Cookie is not a basic login method rather it is an extension of basic Hotspot login method such as HTTP CHAP, HTTP PAP and HTTPS. So, when MAC Cookie is used with these basic Hotspot login methods, it improves the Hotspot user accessibility. In my previous article, I discussed MikroTik Hotspot basic configuration using Winbox with default HTTP CHAP login method. In this article I will discuss how to configure MAC Cookie login in MikroTik Hotspot to improve Hotspot accessibility.
MikroTik Hotspot MAC Cookie
As MAC Cookie is not a basic login method, it should be used with other basic login methods (with HTTP CHAP, HTTP PAP and HTTPS). So, when MAC is enabled with other login methods, the following activities happen in MikroTik Hotspot.
MAC Cookie Keeps Cookie after First Successful Login
If MAC Cookie is used with basic login methods, it keeps the record of username and password for the MAC address after first successful login but username and password must be used from only one MAC address. Cookie will be kept in MikroTik Router until the cookie timeout period is expired.
Hotspot Checks MAC Cookie Record When New Host Appears
When a new Host appears in Hotspot, it checks MAC Cookie record for the MAC Address and logs the host using recorded username name and password if record is found for that MAC Address. If there is more than one host with the same MAC address, user will not be logged in and MAC cookie record for this MAC address will be deleted.
Cookie is removed with MAC Cookie Removal Activities
Cookie is kept in MikroTik Router until MAC Cookie timeout period is expired. But cookie can also be removed with the following activities.
- After successful login, if user clicks on logout button, cookie will be removed from MikroTik Router.
- If admin disconnects user manually from RADIUS Server or from Hotspot active menu.
- If user limit reaches the maximum, cookie will be removed by the NAS-Request.
MAC Cookie Configuration in MikroTik Hotspot
Till now we know how MAC Cookie works in MikroTik Router. Now we will know how to configure MAC Cookie in MikroTik Hotspot. MAC Cookie has to be enabled in two places. So, MAC Cookie configuration can be divided into the following two parts.
- Enabling MAC Cookie in Hotspot Server Profile.
- Enabling MAC Cookie in User Profile.
Part 1: Enabling MAC Cookie in Hotspot Server Profile
To use MAC Cookie feature in MikroTik Hotspot, we have to first enable MAC Cookie in Hotspot Server Profile. The following steps will show how to enable MAC Cookie in MikroTik Hotspot Server Profile.
- Login MikroTik Router with Winbox using full permission user login credentials.
- Go to IP > Hotspot menu item. Hotspot window will appear.
- Click on Server Profiles tab and then double click on active server profile.
- From active server profile windows, click on Login tab and then click on MAC Cookie checkbox.
- Click Apply and OK button.
MAC Cookie is now enabled in Hotspot Server. Now we need to enable MAC Cookie in Hotspot User Profile, for those we want to enable MAC Cookie feature.
Part 2: Enabling MAC Cookie in Hotspot User Profile
MAC Cookie will not be enabled to user level (although we enable it in Hotspot Server) until we enable MAC Cookie in Hotspot User profile. The following steps will show how to enable MAC Cookie in Hotspot User Profile.
- From Hotspot window, click on User Profiles tab and then double click on desired user profile for whose we want to enable MAC Cookie feature. Hotspot User Profile window will now appear.
- From General tab, click on Add MAC Cookie checkbox.
- Default MAC Cookie Timeout period is 3 days. If we want to change MAC Cookie Timeout period, put the timeout period in MAC Cookie Timeout input box.
- Click Apply and OK button.
MAC Cookie feature is now enabled for this profile user. If we wish to enable MAC Cookie for more users, we can do that following the above steps.
Difference between MAC Cookie and HTTP Cookie in MikroTik Hotspot
Sometimes we may be confused about Hotspot MAC Cookie and HTTP Cookie method and we may think these are the same things. But MAC Cookie and HTTP Cookie are not some and they are two different Hotspot login mechanism. The following lists are their mechanistic differences.
- HTTP Cookie is saved both in user browser and MikroTik Router after first successful login whereas MAC Cookie is only saved in MikroTik Router.
- Cookie is sent by the user browser and matched with the local Cookie. If match, user can automatically login otherwise login window is prompted. In MAC Cookie, new host MAC address is matched with the local MAC Cookie record.
- In HTTP Cookie, user browser must be involved but in MAC Cookie browser has no role.
So, HTTP Cookie and MAC Cookie are different in nature and should be enabled separately in MikroTik Hotspot.
If you face any confusion to follow the above steps, watch the following video on MikroTik Hotspot Login By MAC Cookie Configuration. I hope it will reduce your any confusion.
How to configure MAC Cookie in MikroTik Hotspot has been discussed in this article. I hope you will now be able to configure MAC Cookie in your Hotspot Server properly. However, if you face any confusion to configure MAC Cookie in MikroTik Hotspot, feel free to discuss in comment or Contact me from Contact page. I will try my best to stay with you.