Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #56380 > unrolled thread
| Started by | Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> |
|---|---|
| First post | 2013-10-08 13:04 +0300 |
| Last post | 2013-10-09 01:24 +0000 |
| Articles | 12 on this page of 52 — 17 participants |
Back to article view | Back to comp.lang.python
Cookie gets changed when hit comes from a referrer Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> - 2013-10-08 13:04 +0300
Re: Cookie gets changed when hit comes from a referrer Ian Kelly <ian.g.kelly@gmail.com> - 2013-10-08 05:08 -0600
Re: Cookie gets changed when hit comes from a referrer Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> - 2013-10-08 17:18 +0300
Re: Cookie gets changed when hit comes from a referrer Ian Kelly <ian.g.kelly@gmail.com> - 2013-10-08 22:53 -0600
Re: Cookie gets changed when hit comes from a referrer Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> - 2013-10-09 09:47 +0300
Re: Cookie gets changed when hit comes from a referrer Ben Finney <ben+python@benfinney.id.au> - 2013-10-09 18:12 +1100
Re: Cookie gets changed when hit comes from a referrer Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> - 2013-10-08 17:36 +0300
Re: Cookie gets changed when hit comes from a referrer Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-08 15:55 +0000
Re: Cookie gets changed when hit comes from a referrer Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> - 2013-10-08 19:04 +0300
Re: Cookie gets changed when hit comes from a referrer Joel Goldstick <joel.goldstick@gmail.com> - 2013-10-08 13:10 -0400
Re: Cookie gets changed when hit comes from a referrer Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-08 19:29 +0000
Re: Cookie gets changed when hit comes from a referrer Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> - 2013-10-09 01:52 +0300
Re: Cookie gets changed when hit comes from a referrer Ned Batchelder <ned@nedbatchelder.com> - 2013-10-08 19:57 -0400
Re: Cookie gets changed when hit comes from a referrer Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-09 01:33 +0000
Re: Cookie gets changed when hit comes from a referrer Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> - 2013-10-09 11:24 +0300
Re: Cookie gets changed when hit comes from a referrer Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-09 09:44 +0100
Re: Cookie gets changed when hit comes from a referrer Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-09 14:45 +0000
Re: Cookie gets changed when hit comes from a referrer Piet van Oostrum <piet@vanoostrum.org> - 2013-10-09 14:36 -0400
Re: Cookie gets changed when hit comes from a referrer Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> - 2013-10-10 00:29 +0300
Re: Cookie gets changed when hit comes from a referrer Joel Goldstick <joel.goldstick@gmail.com> - 2013-10-09 18:03 -0400
Re: Cookie gets changed when hit comes from a referrer Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-09 23:26 +0100
Re: Cookie gets changed when hit comes from a referrer Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-09 08:00 +0100
Re: Cookie gets changed when hit comes from a referrer Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-09 14:43 +0000
Re: Cookie gets changed when hit comes from a referrer Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> - 2013-10-09 18:00 +0300
Re: Cookie gets changed when hit comes from a referrer Joel Goldstick <joel.goldstick@gmail.com> - 2013-10-09 11:20 -0400
Re: Cookie gets changed when hit comes from a referrer Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-09 16:39 +0100
Re: Cookie gets changed when hit comes from a referrer Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-09 18:06 +0000
Re: Cookie gets changed when hit comes from a referrer Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-09 19:28 +0100
Re: Cookie gets changed when hit comes from a referrer Tim Chase <python.list@tim.thechases.com> - 2013-10-09 14:26 -0500
Re: Cookie gets changed when hit comes from a referrer Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-09 20:40 +0100
Re: Cookie gets changed when hit comes from a referrer Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-09 23:48 +0000
Re: Cookie gets changed when hit comes from a referrer Chris Angelico <rosuav@gmail.com> - 2013-10-10 11:18 +1100
Re: Cookie gets changed when hit comes from a referrer Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-10 00:31 +0000
Re: Cookie gets changed when hit comes from a referrer Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-10 01:10 +0000
Re: Cookie gets changed when hit comes from a referrer Chris Angelico <rosuav@gmail.com> - 2013-10-10 12:28 +1100
Re: Cookie gets changed when hit comes from a referrer Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-10 06:21 +0100
Re: Cookie gets changed when hit comes from a referrer rusi <rustompmody@gmail.com> - 2013-10-09 22:36 -0700
Re: Cookie gets changed when hit comes from a referrer Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-10 06:56 +0100
Re: Cookie gets changed when hit comes from a referrer Ben Finney <ben+python@benfinney.id.au> - 2013-10-10 17:01 +1100
Re: Cookie gets changed when hit comes from a referrer Steven D'Aprano <steve@pearwood.info> - 2013-10-10 07:20 +0000
Re: Cookie gets changed when hit comes from a referrer Steven D'Aprano <steve@pearwood.info> - 2013-10-10 07:18 +0000
Re: Cookie gets changed when hit comes from a referrer Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-10-10 10:50 +0200
Re: Cookie gets changed when hit comes from a referrer Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-10 13:42 +0000
Re: Cookie gets changed when hit comes from a referrer Ben Finney <ben+python@benfinney.id.au> - 2013-10-10 11:43 +1100
Re: Cookie gets changed when hit comes from a referrer Roy Smith <roy@panix.com> - 2013-10-09 20:58 -0400
Learning about HTTP [was: Cookie gets changed when hit comes from a referrer] Tim Golden <mail@timgolden.me.uk> - 2013-10-10 08:44 +0100
Re: Cookie gets changed when hit comes from a referrer Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-10-10 19:45 -0400
Re: Cookie gets changed when hit comes from a referrer Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-10-10 19:48 -0400
Re: Cookie gets changed when hit comes from a referrer Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-09 18:06 +0000
Re: Cookie gets changed when hit comes from a referrer Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> - 2013-10-08 20:30 +0300
Re: Cookie gets changed when hit comes from a referrer Joel Goldstick <joel.goldstick@gmail.com> - 2013-10-08 13:47 -0400
Re: Cookie gets changed when hit comes from a referrer Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-09 01:24 +0000
Page 3 of 3 — ← Prev page 1 2 [3]
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2013-10-10 07:18 +0000 |
| Message-ID | <525654b2$0$29887$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #56540 |
On Wed, 09 Oct 2013 22:36:54 -0700, rusi wrote: > On Thursday, October 10, 2013 6:40:19 AM UTC+5:30, Steven D'Aprano > wrote: >> >> I have no objection to encouraging people to read the fine manual, and >> I don't intend to be Nikos' (or anyone else's) unpaid full-time help >> desk and troubleshooter. But I do think it is simply unfair to treat >> him more harshly than we would others in the same position. If *anyone >> else* asked for help on these sorts of network and browser questions, >> we'd give them more constructive pointers than just "google it". > > https://mail.python.org/pipermail/python-list/2013-October/657221.html That's a good example of exactly the sort of thing I'm talking about. Joel responded with "have you checked the pysvn mailing list" and gave a URL to that list. That is a good, helpful response, given that we can't be expected to know everything about every arbitrary package that might use Python. > https://mail.python.org/pipermail/python-list/2013-October/657034.html And even this got a response suggesting the poster look for an nginx mailing list, which while less helpful than it could have been, was still a concrete, helpful response: not "RTFM", or "just google it", but "that's a problem with nginx, you need an nginx forum, not a Python one". -- Steven
[toc] | [prev] | [next] | [standalone]
| From | Antoon Pardon <antoon.pardon@rece.vub.ac.be> |
|---|---|
| Date | 2013-10-10 10:50 +0200 |
| Message-ID | <mailman.931.1381395032.18130.python-list@python.org> |
| In reply to | #56529 |
Op 10-10-13 03:10, Steven D'Aprano schreef: > On Thu, 10 Oct 2013 00:31:06 +0000, Denis McMahon wrote: >> >> If Nikos can't even figure out the right queries to feed into a search >> engine to get started on such matters as looking at the cookie jar in a >> browser or enabling cookie logging on a server, then he probably >> shouldn't be trying to code at this level. > > Nikos Nikos Nikos... and what about me? If I asked you for a few pointers > about a good place to learn about running a web site, would you tell me > to fuck off too? I wonder what you are doing here, if you are so > unwilling to share your hard-earned knowledge with others as you seem in > this post. This attitude is not the Denis McMahon I'm used to. A year ago no. Now yes! Because you are behaving like an enabler. Nikos is the prime cause of the disruptions here and you are asking we should treat him as if he is a well behaving regular that comes with the occasional off topic question. You seem unable or unwilling to draw a line in how far we should go in enduring Nikos's anti-social behaviour. You seem unable to grasp that how we treat people depends on their behaviour in the past. > Honestly, your response seems to me to be just a more verbose way of > saying "RTFM n00b", and about as helpful. Speaking for myself, I don't > want this forum to be the sort of place where that is considered an > appropriate response, no matter how politely the dismissal is dressed up. But you are cooperating very hard in producing just that. By ignoring the reasons people react harshly to Nikos and pretending such a reaction is a reflection on how they would treat newbies in general you are being extremely unfair. > I'm here to help people, and yes, that even means Nikos. To give back to > the community that helped me (and continues to help me). In my opinion, > if we're going to tell people to RTFM the least we can do is point them > at the right manual, and not just dismiss them by telling them to google > it. I don't think that's too much to ask. And how far are you willing to go with this help? Right now you are helping Nikos in his anti-social behaviour. Is that your idea of giving back to the community? Annoying a significant part of it in your quest to help people? > (On the other hand, it's okay to say "I don't know of any good forums for > learning this stuff. Sorry mate, I can't help.") > > I have no objection to encouraging people to read the fine manual, and I > don't intend to be Nikos' (or anyone else's) unpaid full-time help desk > and troubleshooter. But I do think it is simply unfair to treat him more > harshly than we would others in the same position. If *anyone else* asked > for help on these sorts of network and browser questions, we'd give them > more constructive pointers than just "google it". We don't. The history peope have on this forum is part of the position they are in. If someone has abused the hospitality of an environment, then there is nothing wrong if that environment starts reacting hostile. That is the *situation* Nikos is in now. So stop pretending any regular asking an occasional off topic question would be the same situation. -- Antoon Pardon
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2013-10-10 13:42 +0000 |
| Message-ID | <l36aro$lqf$3@dont-email.me> |
| In reply to | #56529 |
On Thu, 10 Oct 2013 01:10:19 +0000, Steven D'Aprano wrote: >> If Nikos wants to write programs that communicate using internet >> protocols, Nikos really needs to learn where internet protocols are >> defined, how to read and interpret those protocol definitions, and how >> to check that the data he's sending or receiving is the data that he >> thinks he's sending or receiving. > > You can't seriously mean that everyone who runs a website has to become > skilled at reading and interpreting the RFCs for "internet protocols". > Which protocols? All the way down to TCP/IP? I'm not talking about running a website, I'm talking about writing code that uses specific protocols to transfer data. If Nikos is writing code that uses http, then he needs to understand http. His previous questions relating to his wish to spoof ip addresses suggests that in his case, he needs to understand tcp/ip as well. I'm not suggesting that every web admin needs to know these, but anyone who is trying to talk at the protocol level needs to understand the protocol, yes. > Nikos Nikos Nikos... and what about me? If I asked you for a few > pointers about a good place to learn about running a web site, would you > tell me to fuck off too? I wonder what you are doing here, if you are so > unwilling to share your hard-earned knowledge with others as you seem in > this post. This attitude is not the Denis McMahon I'm used to. I'm not unwilling, but this forum is not the place for tcp/ip 101, or http 101, or smtp 101, or dns 101, or geolocation 101, despite Nkos' attempts to turn it into one. This forum is a place for python coding. > Nikos, are you reading this? This is what happens when you behave like a > royal pain in the arse and annoy people. They stop wanting to help you. > Be told. Learn from this. Don't repeat this mistake in the next forum. > If you learn nothing else, learn that lesson. Yes, this is exactly the issue. I am so pissed off with trying to help Nikos and being told things like "Your solution is crap because you use too many lines, even though it works, unlike my [Nikos's] single line effort which I [Nikos] think looks aesthetically wonderful and which must therefore be the superior solution even though it doesn't work". I went so far as to set up mod-wsgi on my server simply to try and understand his cookie issues - before that I hadn't used python on my apache server except at the basic cgi level. I managed to get a functional cookie implementation up and running within a few hours, primarily by reading the relevant api documentation, and looking up a few examples on slashdot and similar. Given that Nikos presents as being a professional coder developing client facing facing python code for a hosting provider, his inability to do something similar, indeed his inability to locate relevant sources of information, is frankly quite astounding, and I am in agreement with the many others on this forum who regularly and frequently voice the opinion that Nikos, specifically, has no business coding anything on a web server. -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2013-10-10 11:43 +1100 |
| Message-ID | <mailman.913.1381365845.18130.python-list@python.org> |
| In reply to | #56521 |
Steven D'Aprano <steve+comp.lang.python@pearwood.info> writes: > So, for the benefit of anyone, not just Nikos, who wants to learn > about how browsers connect to web sites and how to run a web server, > does anyone have any recommendation for tutorials, mailing lists, web > forums or books which are suitable? Preferably things you have used > yourself, and can personally vouch for being useful. I learned a lot from reading the documents at the W3C, since they defined the standards we all use <URL:http://www.w3.org/standards/>. They are very well written and explain a lot about the architecture of the Web. > I'm pretty sure that *somebody* here has been in the position of > needing to learn about running a website, and can point Nikos in the > right direction (away from here). How did you learn? Experiment, observation, and reference to standards. > And if nobody is able, or willing, to answer? I've been in that > position too, asking for help that nobody was able to give. It sucks, > and you move on and do your best. Right. What you don't do is disrupt a discussion forum by bombarding it with off-topic requests; that's a quick way to get a community turn against you. -- \ “I have yet to see any problem, however complicated, which, | `\ when you looked at it in the right way, did not become still | _o__) more complicated.” —Paul Anderson | Ben Finney
[toc] | [prev] | [next] | [standalone]
| From | Roy Smith <roy@panix.com> |
|---|---|
| Date | 2013-10-09 20:58 -0400 |
| Message-ID | <roy-FA0B61.20585409102013@news.panix.com> |
| In reply to | #56521 |
In article <5255eb3c$0$29984$c3e8da3$5496439d@news.astraweb.com>, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > So, for the benefit of anyone, not just Nikos, who wants to learn about > how browsers connect to web sites and how to run a web server, does > anyone have any recommendation for tutorials, mailing lists, web forums > or books which are suitable? Preferably things you have used yourself, > and can personally vouch for being useful. In the way of tools, tcpdump (or wireshark, or whatever packet sniffer you have handy) is invaluable for seeing what's really going on. Also, curl is an amazing tool for sending arbitrary requests to a HTTP server. It's got a zillion options. You'll want to learn what most of them do. The combination of curl and tcpdump is a pretty potent weapon for poking at servers. An interesting alternative to tcpdump/curl is Google Chrome. Open up the developer tools (Command-Option-I on the Mac), click the network tab, and type a request into the address bar. It will capture the outgoing request and the response you get back, and let you dig into them in as much detail as you want. Very handy, at least for GET requests. I imagine any decent browser has similar functionality. For general background, I would start with https://en.wikipedia.org/wiki/Http and keep following links from there until you have read the whole wiki or gotten tired, whichever comes first. stackoverflow has become a really good forum for asking all sorts of programming-related questions (although, its sister site, serverfault, is more appropriate for networking questions). I find the U/I confusing, and often find the rules (i.e. what's allowed and what's not) kind of silly, but a lot of really smart people hang out there. If you want a question answered, go where the smart people are. > I'm pretty sure that *somebody* here has been in the position of needing > to learn about running a website, and can point Nikos in the right > direction (away from here). I guarantee the folks on either stackoverflow or serverfault won't put up with the kind of bullcrap that has been pervading this group as of late. If I was using a program, foo, and had a problem, the first thing I would do is google for "foo mailing list" and see if I can find one. You don't always find one, and sometimes the list is dead, but it's a good place to start. > How did you learn? Run. Fall down. Get up. Start running again. Repeat as needed.
[toc] | [prev] | [next] | [standalone]
| From | Tim Golden <mail@timgolden.me.uk> |
|---|---|
| Date | 2013-10-10 08:44 +0100 |
| Subject | Learning about HTTP [was: Cookie gets changed when hit comes from a referrer] |
| Message-ID | <mailman.928.1381391061.18130.python-list@python.org> |
| In reply to | #56521 |
On 10/10/2013 00:48, Steven D'Aprano wrote: > So, for the benefit of anyone, not just Nikos, who wants to learn about > how browsers connect to web sites and how to run a web server, does > anyone have any recommendation for tutorials, mailing lists, web forums > or books which are suitable? Preferably things you have used yourself, > and can personally vouch for being useful. Not that it's a free resource, but I found this O'Reilly pocket guide useful as a starter. It's not too expensive either. http://shop.oreilly.com/product/9781565928626.do I bought it for my Dad who's a retired civil engineer now happily engaged in setting up small websites for Parish groups and the like. Exactly the kind of thing where he can experiment with a bit of wackiness without people minding too much if things go wrong... (And he does have a test rig at home). As clearly evidenced by the wide range of reactions one sees in answer to "What's the best book...?" questions here, different people have wildly different learning styles. For some, going to the RFCs is *exactly* what they find interesting & illuminating. For others, a step-by-step with screenshots is more the thing, etc. TJG
[toc] | [prev] | [next] | [standalone]
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Date | 2013-10-10 19:45 -0400 |
| Message-ID | <mailman.967.1381448738.18130.python-list@python.org> |
| In reply to | #56521 |
On 09 Oct 2013 23:48:12 GMT, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> declaimed the following:
>On Wed, 09 Oct 2013 18:06:05 +0000, Denis McMahon wrote:
>
>> Find the relevant forums and ask in them.
>
>In fairness to Nikos, that may not be an easy thing to do. I for one have
>*no idea* where to find an appropriate forum to learn about these sorts
>of web basics. comp.protocol.http doesn't exist :-)
>
OTOH, between Earthlink's server (giganews subcontract as I recall) and
gmane -- Doing a search for "http" in Agent's "newsgroup directory" finds
11227 groups... Granted, most of them are gwene "groups" -- RSS feeds to
NNTP access.
172 groups match comp*apache
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
[toc] | [prev] | [next] | [standalone]
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Date | 2013-10-10 19:48 -0400 |
| Message-ID | <mailman.968.1381449007.18130.python-list@python.org> |
| In reply to | #56521 |
On Thu, 10 Oct 2013 11:18:55 +1100, Chris Angelico <rosuav@gmail.com>
declaimed the following:
>
>Personally, what I find most useful is network-level tracing - if I
>want to know what my web server's doing, I'll telnet to it (or, more
>likely, use my MUD client) and look at exactly what it's sending; and
>if I want to know what a browser's doing, I'll do the same (since my
>MUD clients allow me to run them "backwards", listening rather than
>connecting).
>
>But that isn't for everyone, I'm aware of that.
I'd suggest installing WireShark -- but at that level, one had better
understand how to find information about the various protocols first (like:
the many Internet RFCs) so one can decode the data portion carrying the
top-level protocol... While WireShark will break down the Ethernet, IP, and
TCP/UDP/ICMP headers, reading an HTTP request packet "data".
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2013-10-09 18:06 +0000 |
| Message-ID | <l345vc$343$1@dont-email.me> |
| In reply to | #56493 |
On Wed, 09 Oct 2013 18:00:28 +0300, Νίκος Αλεξόπουλος wrote: > Στις 9/10/2013 5:43 μμ, ο/η Denis McMahon έγραψε: >> On Wed, 09 Oct 2013 01:52:44 +0300, Νίκος Αλεξόπουλος wrote: >> >>> Στις 8/10/2013 10:29 μμ, ο/η Denis McMahon έγραψε: >> >>>> Have you checked the cookie jar in the browser to see what value the >>>> cookie has? Is that the value you think it should have? Note that >>>> checking the cookie jar is a browser topic, not a python topic, so if >>>> you don't know how to do that you're going to have to find the right >>>> place to ask, WHICH IS NOT HERE! >>>> Ideally you need to check what the server thinks it's setting the >>>> cooking to, what the browser thinks it received as the cookie, and >>>> what the server gets back afterwards to work out where the error is >>>> happening. >>> Is there something i can try to isolate the problem and make it work? >>> By whole counters project is based on cookie handling now.... >> See those last two paragraphs there that you quoted. You should have >> read them. > ok so then tell me where i should ask this. In those two paragraphs I have told you what you need to do to isolate where your problem is occurring. If you don't know how to do that, then I commend to you the wealth of information that may be discovered using search engines. However, as we keep telling you, this group is not the right place to ask questions such as: a) How do I see what's in my web browser's cookie jar? b) How do I make my web server log the cookies it sends and receives? For (a) you want information about your browser, not about python. For (b) you want information about your web server, not about python. Find the relevant forums and ask in them. -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-10-08 20:30 +0300 |
| Message-ID | <l31fg6$d8b$1@dont-email.me> |
| In reply to | #56423 |
Is there any better way to identif a previous visitor? i tried cookies
which failed for me for the reason i opened this thread and host like
follows:
# try to locate the visitor
cur.execute('''SELECT * FROM visitors WHERE counterID = %s and host =
%s''', (cID, host) )
data = cur.fetchone()
if not data:
# if first time visitor on this page, create new record
cur.execute('''INSERT INTO visitors (counterID, host, city, useros,
browser, ref, lastvisit) VALUES (%s, %s, %s, %s, %s, %s, %s)''',
(cID, host, city, useros, browser, ref, lastvisit) )
else:
# since visitor exists just update his record
cur.execute('''UPDATE visitors SET city = %s, useros = %s, browser =
%s, ref = %s, hits = hits + 1, lastvisit = %s''', (city, useros,
browser, ref, lastvisit) )
=======
Please tell me if you can think fo something else.
[toc] | [prev] | [next] | [standalone]
| From | Joel Goldstick <joel.goldstick@gmail.com> |
|---|---|
| Date | 2013-10-08 13:47 -0400 |
| Message-ID | <mailman.870.1381254441.18130.python-list@python.org> |
| In reply to | #56433 |
On Tue, Oct 8, 2013 at 1:30 PM, Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> wrote:
> Is there any better way to identif a previous visitor? i tried cookies which
> failed for me for the reason i opened this thread and host like follows:
>
> # try to locate the visitor
> cur.execute('''SELECT * FROM visitors WHERE counterID = %s
> and host = %s''', (cID, host) )
> data = cur.fetchone()
>
> if not data:
> # if first time visitor on this page, create new
> record
> cur.execute('''INSERT INTO visitors (counterID,
> host, city, useros, browser, ref, lastvisit) VALUES (%s, %s, %s, %s, %s, %s,
> %s)''',
> (cID, host, city, useros,
> browser, ref, lastvisit) )
> else:
> # since visitor exists just update his record
> cur.execute('''UPDATE visitors SET city = %s, useros
> = %s, browser = %s, ref = %s, hits = hits + 1, lastvisit = %s''', (city,
> useros, browser, ref, lastvisit) )
> =======
>
> Please tell me if you can think fo something else.
Yes! there is a very simple and comprehensive way to learn about your
visitors. Use Google Analytics. Its free, you only need a google
account to open an analytics account. They give you a small bit of
javascript that you copy and past to your pages. If you are using a
template to create your pages, this is easy, since you just add google
code to the template.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
--
Joel Goldstick
http://joelgoldstick.com
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2013-10-09 01:24 +0000 |
| Message-ID | <5254b039$0$29984$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #56436 |
On Tue, 08 Oct 2013 13:47:14 -0400, Joel Goldstick wrote: > Yes! there is a very simple and comprehensive way to learn about your > visitors. Use Google Analytics. Its free, you only need a google > account to open an analytics account. http://images.wikia.com/darkheresy/images/0/0c/Its_a_trap.jpg There is a very simple and comprehensive way for Google to learn about your visitors: Google Analytics. -- Steven
[toc] | [prev] | [standalone]
Page 3 of 3 — ← Prev page 1 2 [3]
Back to top | Article view | comp.lang.python
csiph-web