Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'explicit': 0.07; 'initialize': 0.07; 'cookie': 0.09; 'except:': 0.09; 'hiding': 0.09; 'try:': 0.09; 'benjamin': 0.16; 'check.': 0.16; 'received:192.168.1.20': 0.16; 'subject:issue': 0.16; 'error': 0.23; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'code': 0.31; 'subject:with': 0.35; 'except': 0.35; 'received:google.com': 0.35; 'charset:us-ascii': 0.36; 'skip:o 20': 0.38; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'browser': 0.61; 'you.': 0.62; 'header:Message-Id:1': 0.63; 'url:17': 0.68; 'browser.': 0.78; 'url:posts': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schollnick.net; s=schollnick; h=sender:from:content-type:message-id:mime-version:subject:date :references:to:in-reply-to; bh=XYryu9NbQfGbOVgef3279oyiwXgwF3GzYQvRReWDF+0=; b=ay7k4YP/ibC+uUuurXjXCDGxqmKx7/ePVUWpVPhCe72j+Q08ra5oEYZy/NjeLeRWGm 4BQxzzd5kfXUXxkz/IE3u8lEtJIdGACqJGFeD1mraECrkNsjKlaESX10y7p61i7rUQSO mrxymzKQO0etl/VWhrHbFmNJfMq6yrvKbSrjo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:message-id:mime-version :subject:date:references:to:in-reply-to; bh=XYryu9NbQfGbOVgef3279oyiwXgwF3GzYQvRReWDF+0=; b=jYVhe8tINuyA5k7S4ueUCyvbbmSM6cN8Ku9CMzDSvTfYzFspvvYbrIHYLeUvraLKat VXytIXGNe+8c9NEmKQf4zwNQgDpEsCI7o/0qcOa/L2h5MTfKbyt730obQGxrHQUTFFAm C6NtzrQ2gFxmoVGHeB/FdVjkH8upFvur05NIGuaoTkgoJqxtwVOEtE939cSQ4PtRloUm /GdHAs+3TNH2hNlgHppUixr35uFNrbvqO6BylbGZqtIF5E00GCq5GunuTiLnokjLvPBq 5KJCvyaMrBnt1SC2RUySG/BJ6yAnKEz6iM6YSc/Ol9QqC9MMlm7XLbYzcBcYjHF3q5Rc dHYg== X-Gm-Message-State: ALoCoQkoF3bc4psmHUsjm13biHHptdiDmgMlr7HDne4kR52FaCnb0tTmY4LCQ+YeDv3jK0S8bVIe X-Received: by 10.50.22.67 with SMTP id b3mr5962212igf.39.1382901928928; Sun, 27 Oct 2013 12:25:28 -0700 (PDT) Sender: Benjamin Schollnick From: Benjamin Schollnick Content-Type: multipart/alternative; boundary="Apple-Mail=_F1ACD1D9-7FD4-44A7-9730-54B3B1E43FF2" Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Subject: Re: Cookie issue(cant fix it with anyhting) Date: Sun, 27 Oct 2013 15:25:23 -0400 References: To: python-list@python.org In-Reply-To: X-Mailer: Apple Mail (2.1816) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 58 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382902405 news.xs4all.nl 16001 [2001:888:2000:d::a6]:34631 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57760 --Apple-Mail=_F1ACD1D9-7FD4-44A7-9730-54B3B1E43FF2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Nikos, Hello i having the following code to try and retrieve the visitor's >> saved cookie form the browser. >>=20 >> [CODE] >> # initialize cookie and retrieve cookie from clients browser try: >> cookie =3D cookies.SimpleCookie( os.environ['HTTP_COOKIE'] ) >> cookieID =3D cookie['name'].value >> except: >> cookieID =3D 'visitor' As it has been said before, change the except to be an explicit error = check. =20 The all purpose except is hiding an error condition from you. Take a look at this: http://www.jayconrod.com/posts/17/how-to-use-http-cookies-in-python - Benjamin --Apple-Mail=_F1ACD1D9-7FD4-44A7-9730-54B3B1E43FF2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
Nikos,

Hello i having = the following code to try and retrieve the visitor's
saved cookie form the = browser.

[CODE]
# initialize cookie and retrieve cookie from = clients browser try:
    cookie =3D = cookies.SimpleCookie( os.environ['HTTP_COOKIE'] )
=     cookieID =3D cookie['name'].value
except:
=     cookieID =3D = 'visitor'

As it has been = said before, change the except to be an explicit error check. =  
The all purpose except is hiding an error condition = from you.

Take a look at = this:


- = Benjamin


= --Apple-Mail=_F1ACD1D9-7FD4-44A7-9730-54B3B1E43FF2--