Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
10-11-2011, 10:46 PM #1
- Join Date
- Oct 2011
- Thanked 0 Times in 0 Posts
pull variable from cookie filename
10-12-2011, 12:49 AM #2
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?Code:str = "cookie:firstname.lastname@example.org/" ; var uName = ( uName = str.match( /^cookie:([^@]+)@/ ) ) ? uName[ 1 ] : "" ; alert( uName );
10-12-2011, 03:00 AM #3
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.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.