The reason behind dwelling in a Sukkah:
The reason G-d commanded us to sit in a Sukkah for shade is so we recall the miracles and wonders done for us in the desert, in which the clouds of glory surrounded us for shade, as protection from the sun. When dwelling in a Sukkah one must have intent to do so in order to fulfill G-d’s command to sit in a Sukkah in commemoration of the Exodus. This obligation to have intent during the dwelling is learned from the verse “So you shall know”.
Must one have this intent every time he dwells in the Sukkah?
Yes. Each time one eats in the Sukkah, and fulfills the Mitzvah of dwelling in the Sukkah, he is to intend to fulfill the Mitzvah for the above mentioned reason of commemorating the exodus.
 This ruling of Admur follows the ruling of Rebbe Eliezer in the Gemara. However according to Rebbe Akiva we slept in actual Sukkahs, and according to him the reason behind Sukkos is to remember all the kindness that Hashem provides us with [Rashbam].
 Tzaruch Iyun from this wording if one is to intend on the clouds of glory as well as the exodus, or simply intending on the exodus suffices. However from the fact that Admur and Michaber bring the above reason of the clouds of glory it implies that it is this specific intention that one must have. Vetzaruch Iyun according to this why Admur [from Magen Avraham] wrote exodus as opposed to the clouds of glory. To note from Taz  which explains that remembering the exodus is the reason according to Rebbe Akivah, while remembering the clouds of glory is the reason according to Rebbe Eliezer. The Peri Megadim rules that it is implied from the Magen Avraham that there is no need to intend for the clouds of glory, although based on the Taz it is proper to have both intentions. Perhaps according to Admur it is also needed to have both intents and he thus brought down both reasons.