Which one is Best for Redirecting User to Other Location, Local Storage or Cookies [closed]2019 Community Moderator ElectionWhen do items in HTML5 local storage expire?Local Storage vs CookiesWhat is the best way to securely authenticate a user ? (session, cookies, php, mysql)HTML5 Local storage vs. Session storageRedirect user to website based on stored cookie informationRemember selection - then redirect to correct home page on visitsChanging A Contact Form Based On A Cookie Or (Other Solution)?How to set cookies and redirect in php?Browser local storage missing after Patreon redirectConditional Drop-down Redirect with Cookies

Is it insecure to send a password in a `curl` command?

Writing in a Christian voice

Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?

What is the English word for a graduation award?

What is the term when voters “dishonestly” choose something that they do not want to choose?

Light propagating through a sound wave

I got the following comment from a reputed math journal. What does it mean?

Do native speakers use "ultima" and "proxima" frequently in spoken English?

Synchronized implementation of a bank account in Java

Recruiter wants very extensive technical details about all of my previous work

Is it true that good novels will automatically sell themselves on Amazon (and so on) and there is no need for one to waste time promoting?

Asserting that Atheism and Theism are both faith based positions

Generic TVP tradeoffs?

In Aliens, how many people were on LV-426 before the Marines arrived​?

Variable completely messes up echoed string

Suggestions on how to spend Shaabath (constructively) alone

Fewest number of steps to reach 200 using special calculator

Help prove this basic trig identity please!

What favor did Moody owe Dumbledore?

Is there a creature that is resistant or immune to non-magical damage other than bludgeoning, slashing, and piercing?

What exactly term 'companion plants' means?

Am I eligible for the Eurail Youth pass? I am 27.5 years old

What does Deadpool mean by "left the house in that shirt"?

How is the partial sum of a geometric sequence calculated?



Which one is Best for Redirecting User to Other Location, Local Storage or Cookies [closed]



2019 Community Moderator ElectionWhen do items in HTML5 local storage expire?Local Storage vs CookiesWhat is the best way to securely authenticate a user ? (session, cookies, php, mysql)HTML5 Local storage vs. Session storageRedirect user to website based on stored cookie informationRemember selection - then redirect to correct home page on visitsChanging A Contact Form Based On A Cookie Or (Other Solution)?How to set cookies and redirect in php?Browser local storage missing after Patreon redirectConditional Drop-down Redirect with Cookies










-2















I am planning to create a landing page for a website asking visitor for their province of living in Radio-input elements and then redirect the user to sub-folder/sub-domain with specific design for that area (province). I would like to store the user selection then in the nest visit redirect the request to the associated sub-folder/sub-domain without going to landing page. Now I am not sure which one is the best option for doing this



A- JavaScript Old well-know Cookies

B- Browser Local Storage



Can you please advise which one is the best for this purpose considering the fact that I will store the selected value by user selection on radios?










share|improve this question













closed as primarily opinion-based by Luca Kiebel, AdrianHHH, Heretic Monkey, Paul Roub, Machavity Mar 6 at 22:26


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.


















  • localStorage would be better because cookies bloat your server responses.

    – dandavis
    Mar 6 at 21:43











  • Thanks dandavis

    – Mona Coder
    Mar 6 at 21:44






  • 1





    We can't tell you want is best; there are too many factors to consider and it will end up being a popularity contest. For instance, in some regions there are laws regarding the use of cookies; others include local storage in those regulations.

    – Heretic Monkey
    Mar 6 at 21:44











  • Cookies are far easier, but things are a changing and making it so only basic access tokens should be stored in cookies in the future. but we're not quite there yet.

    – Steven Stark
    Mar 6 at 21:46











  • @HereticMonkey, thanks for reply but out of these kind of limits and talking technically only which one is the better way?

    – Mona Coder
    Mar 6 at 21:46















-2















I am planning to create a landing page for a website asking visitor for their province of living in Radio-input elements and then redirect the user to sub-folder/sub-domain with specific design for that area (province). I would like to store the user selection then in the nest visit redirect the request to the associated sub-folder/sub-domain without going to landing page. Now I am not sure which one is the best option for doing this



A- JavaScript Old well-know Cookies

B- Browser Local Storage



Can you please advise which one is the best for this purpose considering the fact that I will store the selected value by user selection on radios?










share|improve this question













closed as primarily opinion-based by Luca Kiebel, AdrianHHH, Heretic Monkey, Paul Roub, Machavity Mar 6 at 22:26


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.


















  • localStorage would be better because cookies bloat your server responses.

    – dandavis
    Mar 6 at 21:43











  • Thanks dandavis

    – Mona Coder
    Mar 6 at 21:44






  • 1





    We can't tell you want is best; there are too many factors to consider and it will end up being a popularity contest. For instance, in some regions there are laws regarding the use of cookies; others include local storage in those regulations.

    – Heretic Monkey
    Mar 6 at 21:44











  • Cookies are far easier, but things are a changing and making it so only basic access tokens should be stored in cookies in the future. but we're not quite there yet.

    – Steven Stark
    Mar 6 at 21:46











  • @HereticMonkey, thanks for reply but out of these kind of limits and talking technically only which one is the better way?

    – Mona Coder
    Mar 6 at 21:46













-2












-2








-2








I am planning to create a landing page for a website asking visitor for their province of living in Radio-input elements and then redirect the user to sub-folder/sub-domain with specific design for that area (province). I would like to store the user selection then in the nest visit redirect the request to the associated sub-folder/sub-domain without going to landing page. Now I am not sure which one is the best option for doing this



A- JavaScript Old well-know Cookies

B- Browser Local Storage



Can you please advise which one is the best for this purpose considering the fact that I will store the selected value by user selection on radios?










share|improve this question














I am planning to create a landing page for a website asking visitor for their province of living in Radio-input elements and then redirect the user to sub-folder/sub-domain with specific design for that area (province). I would like to store the user selection then in the nest visit redirect the request to the associated sub-folder/sub-domain without going to landing page. Now I am not sure which one is the best option for doing this



A- JavaScript Old well-know Cookies

B- Browser Local Storage



Can you please advise which one is the best for this purpose considering the fact that I will store the selected value by user selection on radios?







javascript html5 cookies local-storage






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 6 at 21:39









Mona CoderMona Coder

2,496144288




2,496144288




closed as primarily opinion-based by Luca Kiebel, AdrianHHH, Heretic Monkey, Paul Roub, Machavity Mar 6 at 22:26


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as primarily opinion-based by Luca Kiebel, AdrianHHH, Heretic Monkey, Paul Roub, Machavity Mar 6 at 22:26


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.














  • localStorage would be better because cookies bloat your server responses.

    – dandavis
    Mar 6 at 21:43











  • Thanks dandavis

    – Mona Coder
    Mar 6 at 21:44






  • 1





    We can't tell you want is best; there are too many factors to consider and it will end up being a popularity contest. For instance, in some regions there are laws regarding the use of cookies; others include local storage in those regulations.

    – Heretic Monkey
    Mar 6 at 21:44











  • Cookies are far easier, but things are a changing and making it so only basic access tokens should be stored in cookies in the future. but we're not quite there yet.

    – Steven Stark
    Mar 6 at 21:46











  • @HereticMonkey, thanks for reply but out of these kind of limits and talking technically only which one is the better way?

    – Mona Coder
    Mar 6 at 21:46

















  • localStorage would be better because cookies bloat your server responses.

    – dandavis
    Mar 6 at 21:43











  • Thanks dandavis

    – Mona Coder
    Mar 6 at 21:44






  • 1





    We can't tell you want is best; there are too many factors to consider and it will end up being a popularity contest. For instance, in some regions there are laws regarding the use of cookies; others include local storage in those regulations.

    – Heretic Monkey
    Mar 6 at 21:44











  • Cookies are far easier, but things are a changing and making it so only basic access tokens should be stored in cookies in the future. but we're not quite there yet.

    – Steven Stark
    Mar 6 at 21:46











  • @HereticMonkey, thanks for reply but out of these kind of limits and talking technically only which one is the better way?

    – Mona Coder
    Mar 6 at 21:46
















localStorage would be better because cookies bloat your server responses.

– dandavis
Mar 6 at 21:43





localStorage would be better because cookies bloat your server responses.

– dandavis
Mar 6 at 21:43













Thanks dandavis

– Mona Coder
Mar 6 at 21:44





Thanks dandavis

– Mona Coder
Mar 6 at 21:44




1




1





We can't tell you want is best; there are too many factors to consider and it will end up being a popularity contest. For instance, in some regions there are laws regarding the use of cookies; others include local storage in those regulations.

– Heretic Monkey
Mar 6 at 21:44





We can't tell you want is best; there are too many factors to consider and it will end up being a popularity contest. For instance, in some regions there are laws regarding the use of cookies; others include local storage in those regulations.

– Heretic Monkey
Mar 6 at 21:44













Cookies are far easier, but things are a changing and making it so only basic access tokens should be stored in cookies in the future. but we're not quite there yet.

– Steven Stark
Mar 6 at 21:46





Cookies are far easier, but things are a changing and making it so only basic access tokens should be stored in cookies in the future. but we're not quite there yet.

– Steven Stark
Mar 6 at 21:46













@HereticMonkey, thanks for reply but out of these kind of limits and talking technically only which one is the better way?

– Mona Coder
Mar 6 at 21:46





@HereticMonkey, thanks for reply but out of these kind of limits and talking technically only which one is the better way?

– Mona Coder
Mar 6 at 21:46












1 Answer
1






active

oldest

votes


















1














Use a cookie only if you need the information to be sent to the server, when that information won't get sent to the server otherwise - otherwise, there's no need for the extra baggage in network requests.



If you want users to be redirected from the server, then save the information in a cookie, and look up the cookie value when the landing page is requested, then serve the appropriate subdomain page. (If you use cookies, you may have to provide a disclaimer.)



If you want users to be redirected with client-side Javascript (such as by assigning to window.location.href when the visitor visits the landing page), and the server has no need to see their locale information on every connection, then use Local Storage.



Server-side redirection is probably more elegant, but both methods are OK options. It depends on the sort of behavior you want visitors to see, and your back-end setup.






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Use a cookie only if you need the information to be sent to the server, when that information won't get sent to the server otherwise - otherwise, there's no need for the extra baggage in network requests.



    If you want users to be redirected from the server, then save the information in a cookie, and look up the cookie value when the landing page is requested, then serve the appropriate subdomain page. (If you use cookies, you may have to provide a disclaimer.)



    If you want users to be redirected with client-side Javascript (such as by assigning to window.location.href when the visitor visits the landing page), and the server has no need to see their locale information on every connection, then use Local Storage.



    Server-side redirection is probably more elegant, but both methods are OK options. It depends on the sort of behavior you want visitors to see, and your back-end setup.






    share|improve this answer



























      1














      Use a cookie only if you need the information to be sent to the server, when that information won't get sent to the server otherwise - otherwise, there's no need for the extra baggage in network requests.



      If you want users to be redirected from the server, then save the information in a cookie, and look up the cookie value when the landing page is requested, then serve the appropriate subdomain page. (If you use cookies, you may have to provide a disclaimer.)



      If you want users to be redirected with client-side Javascript (such as by assigning to window.location.href when the visitor visits the landing page), and the server has no need to see their locale information on every connection, then use Local Storage.



      Server-side redirection is probably more elegant, but both methods are OK options. It depends on the sort of behavior you want visitors to see, and your back-end setup.






      share|improve this answer

























        1












        1








        1







        Use a cookie only if you need the information to be sent to the server, when that information won't get sent to the server otherwise - otherwise, there's no need for the extra baggage in network requests.



        If you want users to be redirected from the server, then save the information in a cookie, and look up the cookie value when the landing page is requested, then serve the appropriate subdomain page. (If you use cookies, you may have to provide a disclaimer.)



        If you want users to be redirected with client-side Javascript (such as by assigning to window.location.href when the visitor visits the landing page), and the server has no need to see their locale information on every connection, then use Local Storage.



        Server-side redirection is probably more elegant, but both methods are OK options. It depends on the sort of behavior you want visitors to see, and your back-end setup.






        share|improve this answer













        Use a cookie only if you need the information to be sent to the server, when that information won't get sent to the server otherwise - otherwise, there's no need for the extra baggage in network requests.



        If you want users to be redirected from the server, then save the information in a cookie, and look up the cookie value when the landing page is requested, then serve the appropriate subdomain page. (If you use cookies, you may have to provide a disclaimer.)



        If you want users to be redirected with client-side Javascript (such as by assigning to window.location.href when the visitor visits the landing page), and the server has no need to see their locale information on every connection, then use Local Storage.



        Server-side redirection is probably more elegant, but both methods are OK options. It depends on the sort of behavior you want visitors to see, and your back-end setup.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 6 at 22:13









        SnowSnow

        90319




        90319















            Popular posts from this blog

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved