The Facebook Platform   
    Home  |   Learn AJAX  |   Forum  |    Register  |    Submit Resource  |   Submit Article   |   Contact Us
 

JavaScript

Home JavaScript

Setting Cookies in Headers for JavaScript

Category: JavaScript   |   Comments (0)

JavaScript and Ajax based applications are often considered as a highly unique programming technique. While many programming languages can stand on its own, Ajax is known as a "mash up" of various programming languages. Instead of simply using JavaScript, the use of XML, HTTP and other programming language has made Ajax a very challenging.


Sponsored Links
 

 


Of course, JavaScript can stand on its own but developers can do much more by adding other programming languages. Fortunately frameworks, libraries and other tools were created to automate some of the process to easily develop online applications based on JavaScript and Ajax.


But the required learning process of Ajax and JavaScript do not mean that it's a totally different programming language. These tools still has to comply with some of the standards or else they will never be implemented. This is actually the good thing about Ajax and JavaScript.


While the programming language pushes the capabilities of online application, developers can still start slow in Ajax because some basics that can be considered as the "base" in starting a programming language are still there. The learning requirement is still there but many developers have enough knowledge to start creating basic Ajax and JavaScript based applications.


One of those things that can help developers start fast in building an Ajax based applications is on headers. Every developer is familiar with HTTP-based headers. Its function is basically to lay the ground on what to expect from the website. This is also true in JavaScript and the best part is that there is no extra configuration required.


Developers can practically create an HTTP based header that will set the cookies for the server. This will still work even though the client side is using JavaScript. The return from the server is still the same and JavaScript will still accept the information.


However, there is one consideration developers have to remember when setting cookies in HTTP for JavaScript. The client side script has a big influence on the cookies set in HTTP. It should be emphasized that one of perennial problems in the early days of JavaScript and Ajax is through cookies. The online application will not work as expected because the functions would have some trouble dealing with cookies. For that reason, the client side script has to be implemented that contains some functions on how to deal with cookies in JavaScript and Ajax based applications.


Creating an Ajax or JavaScript based application is no walk in the park. Aside from figuring out how to effectively code the application, developers have to remember how to improve the security of their application. The client side functionality of JavaScript can be easily attacked when the code is not optimized for security.



Sponsored Links
 

 

On the other hand, there are still things in the application that do not require extensive learning. Cookies in JavaScript will still work as expected even though it is set using HTTP. This means developers can easily set the cookies simply because of familiarity. As long as the script in the client side allows, the cookies can be done in HTTP.



Read Next: JavaScript Confirm Function


 
Post Your Comment
Members - Please Click here Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification:
 
 Subscribe    

Post Your Comment via FaceBook

Connect with Facebook



 
Comments
 
 
 
 

Sponsored Links

 

Copyright © 2005 - 2010 AjaxWith.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape