View Full Version : pull variable from cookie filename
10-11-2011, 10:46 PM
10-12-2011, 12:49 AM
str = "cookie:email@example.com/" ;
var uName = ( uName = str.match( /^cookie:([^@]+)@/ ) ) ? uName[ 1 ] : "" ;
alert( uName );
The above statements would extract the part of str betrween : and @. If I understand what you're doing, first you have to find a cookie name that matches the required format, and you must ensure that there is never more than one of those stored on any given browser or how would you distinguish them?
10-12-2011, 03:00 AM
I give up. How can you even *READ* the cookie file names???
In general, the browser will *NOT* give you access to files stored on the user's computer. You can do this with MSIE, using the Scripting.FileSystemObject ActiveX control, but only if the user's MSIE browser settings allow it (and even then it has to be approved each time it is used).
Reading the cookie--without knowing or needing to know the filename--would be much the preferable way. It works cross-browser and requires no special permissions.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.