Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

PDF:

Feature

Web Applications

Create web applications using Real Studio

Issue: 10.4 (May/June 2012)
Author: Paul Lefebvre
Article Description: No description available.
Article Length (in bytes): 2,901
Starting Page Number: 77
RBD Number: 10411
Resource File(s): None
Related Link(s): None
Known Limitations: None

Excerpt of article text...

All web sites and web applications have a standard way of retaining user data: cookies. Real Studio web applications also have several methods for accessing cookies, all of which are part of the Session class.

So what is a cookie? It is just string data that is retained by the browser so that it can be retrieved later. Cookies are stored for each session so that the values that you save for each user are completely independent.

Cookies have limitations. The biggest is that they might not be enabled. Users can choose to disable cookies in their browser security settings. Most users do not do this since it breaks much of the way the web works, but it is something to keep in mind.

Saving a Value with a Cookie

To save a value with a Cookie, you simply set the Cookie. This code sets a cookie called "UserName" to the value in the userName string:

Session.Cookies.Set("UserName", userName)

By default, cookies expire when the browser is closed. These are called "session cookies."

For some values, you may want to retain the cookie so that it is available the next time the user connects to your web application. These are called "persistent cookies."

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com