The document.cookie Property is available in DOM for accessing cookie values in javascript. This Property returns all of the cookies in a long semicolon separated string. For example:
cookie1=value1; cookie2=value2; cookie3=value3; ...
There is no way of accessing individual cookie values like we access Request variables on the server side. You must extract the required cookie value from one long string. It can be easily done with a few lines of code, but if you like the way things work on the server side, here is a small helper Javascript function I wrote to prepare a dictionary with all cookie values. Now instead of trying to extract value from a long string, you can use the following code:
var cookies = getCookies();
var value1 = cookies["cookieName"];
//Now value1 holds the value of cookie "cookieName"
Makes things easier especially when multiple cookies are in use. Here is the helper function that prepares a dictionary with all available cookies and values:
function getCookies()
{
var cks = new Object();
var ckList = document.cookie.split("; ");
for (var i=0; i < ckList.length; i++)
{
var ck = ckList[i].split("=");
cks[ck[0]] = unescape(ck[1]);
}
return cks;
}
This code has been used in several places without any problems. If you encounter any issue, please post a comment.
Posted on February 11, 2010 09:50 by
Haider
For sometime, there was no major update on www.dojolocator.com. In case you did not know, dojolocator.com is the best place online if you are looking to find a Dojo. Currently there are over 16 thousand Dojos listed.
We had many enhancements in the to-do list, but other things kept getting in the way.
Meanwhile more and more Dojo gets listed on www.dojolocator.com everyday.
So last week we sat down and pushed some updates that were long due. Here is a short list of changes:
- Location Search on home page now understands complete address, zip code or city name.
- Home page now shows a list of recently updated Dojo, and a list of recently listed Dojo.
- Each Dojo now has a sub directory dedicated to them, with an URL similar to www.dojolocator.com/dojo-name
- Each Dojo sub directory has 4 pages related to the Dojo
- Driving Directions are no longer linked to external Website, they are now shown within dojolocator.com
- Updated style information, now about 70% Dojos have their style information available
- Most common Dojo Names. List of Dojo names most commonly used in the USA.
Soon we will add Map based search of Dojos. We also wish to open dojolocator.com to other countries.
Posted on November 25, 2009 09:06 by
Haider
Windows Server 2008 Media only comes in a DVD. The reason is probably that it is over 3GB in size, and most machines would have a DVD drive these days.
But a slim DVD may not always be present in a rackmount server. In my case several of the servers don't have a DVD Drive.
Now with a recent BIOS, you could connect an external DVD Drive and boot from it, but having a Flash drive plugged in and install from it is a easier, and faster option. New to Windows 2008 setup is the ability to load RAID drivers from a media other than a floppy drive. So you could put the required RAID drivers and the Windows 2008 Setup all on one flash drive and install from it.
There was no confirmation from Dell tech support that it would be possible on a PowerEdge 2850. The first generation of 2850 came out over 3 years ago, so I was curious if the BIOS would support booting from a USB Flash drive and Windows 2008 would install on it.
The trick is to make a Flash drive bootable with a FAT32 partition, and copy all installation files from the DVD to the Flash Drive. Now setup the server BIOS to use a USB Drive as the boot drive, if available.
All went well with this installation and I had a Windows 2008 R2 installed on this server fairly quick. I think the actual installation took less then half hour.
Of course, quite bit of research took place prior to my attempt, specially in search for a confirmation that anyone has been successful doing it.
To make a flash drive bootable, I used the diskpart.exe Utility. Diskpart is a command line Utility and it is not available in any of the Home Editions of XP or Vista. I found it on XP Pro, Vista Business, and Windows 7 Professional. Before you start, make sure the USB drive is plugged in, and find out the drive's serial number with DiskPart. At Command Prompt, type diskpart <enter>, followed by: list disk. This will give you a list of disks and their serial number. Identify the Flash Drive and note the serial number.
Here is the command Here is the sequence of commands that makes the Flash drive bootable:
- diskpart
- select disk <diskserial>
- clean
- create partition primary
- select partition 1
- active
- assign
- exit
Now copy all files from the Windows 2008 Setup DVD on to this Flash Drive. If you need RAID Controller Driver files, create a folder on this Flash Drive and copy all the drivers into it.
Locate and set the option to boot from a USB Drive in the server BIOS, and you are ready to boot!
Installation of Windows 2008 is similar to installing Vista, so make sure that appropriate drivers are available for the server hardware. If the server is too old, you might run into issues.
Another good thing about the installation of Windows Server 2008, is that it is totally graphical, no more mixing of text based interface and GUI, and I have upgraded a Windows 2008 Standard to Windows 2008 Enterprise from a virtual media mounted with a Utility that mounts an .iso image as a Disk Drive. It went smooth.
Posted on November 10, 2009 06:31 by
Haider
I have been planning on doing a network utility Website (Ping, Trace Route, DNS Lookup, Whois Lookup etc.) for a long time, and here it is: www.tcpzone.com
Built with ASP.NET 3.5 (of course) and running on a Windows Server.
The tools are meant to be interactive and flexible. It is at a very early stage. But all of the tools are functional.
Posted on September 29, 2009 07:04 by
Haider
It is true! I don't know when it happened, but suddenly I realized this week that there is a "Synchronized Browsing" option available in the Site Manager of FileZilla FTP Client.
I have waited too long for this feature.
In large Website projects with too many folders, it has been a huge pain keeping both side of the folder browsers in sync. Sometimes I would publish files in a wrong folder, causing the site to crash! Other than the lack of synchronized browsing, FileZilla is an excellent FTP client, in my opinion it is better than any other FTP software I have used, free or paid. Aside from being Free and Open Source, the development is very active and it supported Secure FTP, which I always use.
Check out the 'Advance' tab of the site manager for the Synchronized browse option. There is also a Toolbar button to toggle Synchronized browsing on and off.
Posted on July 29, 2009 08:47 by
Haider