![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programming Guru
![]() |
Yay! I got it setup here: http://o2jamrecall.dyndns.info:8080/
When I have the python console running, it says the IP address of everyone who accesses any page. Is there any way to grab that IP address? I need it to create a log of sessions by mapping the username to something as unique as an IP address. (I'm aware PyCherry has built in Sessions, but I'd like to have control over their functionality) And how do I get rid of that "Build Time, Page Size". o_o;; Right now I just cheated by making the color white and the text small. |
|
|
|
|
|
#12 | ||
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
But, if you want the IP, I suggest looking at the cherrypy.request object (in the documentation I linked to, it calls it the cpg.request object; ignore this, with 2.1 it's been changed to cherrypy.request) class HelloWorld: @cherrypy.expose def index(self): return "Your IP: %s!" % cherrypy.request.remoteAddr Quote:
The Build Time thingy is part of the Log debug filter. To disable it, make a config file like so: [global] logDebugInfoFilter.on = False To load this configuration file: import cherrypy class HelloWorld: @cherrypy.expose def index(self): return "Hello world!" cherrypy.root = HelloWorld() cherrypy.config.update(file = "config.ini") cherrypy.server.start() cherrypy.config.update({
'global' : {'logDebugInfoFilter.on' : False}
})[global] server.port = 80 logDebugInfoFilter.on = False |
||
|
|
|
|
|
#13 | ||
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
Quote:
|
||
|
|
|
|
|
#14 |
|
Programming Guru
![]() |
Wow! Thanks again for all the usefull information! But if I'm going to do session IDs I would need to save that sessionID to the user who logged in's computer, correct? Is there a way I can do this?
|
|
|
|
|
|
#15 | |||
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Quote:
Quote:
Quote:
a) Append that session ID to all links for your current domain b) Put it in a cookie Method b) technically does write to their computer. You then read the session ID and do whatever accordingly. |
|||
|
|
|
|
|
#16 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
You can also make your session cookie have an extremely long expiry date, essentially making it indefinite. Google does this; it's cookie will only expire in 2038. However, you can't guarentee that the user won't wipe their cookie cache, or use another browser. What exactly do you want to achieve? |
|
|
|
|
|
|
#17 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
Besides, it doesn't take too much effort to secure a website nowadays. With a bit of knowledge and some spare time, you can easily host a site that is just as secure as the vast majority of webservers. And if you're willing to take the time setting up security tools such as SELinux or Tripwire, then you can host a site that is amongst the most secure on the web. |
|
|
|
|
|
|
#18 | |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Quote:
![]()
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
|
#19 |
|
Programming Guru
![]() |
Okay, I'm fairly sure I've got this working very well.
Care testing it? I'm logged in right now under the username Saney, IP 70.49.132.3 Try to hijack my session. You'll know you're logged in when you know longer see the two forms at the top of the page, and you're able to access http://jammersbase.dyndns.org/modifyscores Here's the site http://jammersbase.dyndns.org/ Yes, I know it looks quite welfare, but I'm still developing framwork here. |
|
|
|
|
|
#20 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Looks good so far - though the HTML is missing <html> tags, a <head> and a <body>. You might want to try out a templating system with CherryPy if you're not already; separating HTML and Python code is usually a good idea.
What does the login system use? An SQL query? It seems happily immune from injection attacks, so that's good news ![]() Does the login system use sessions, and check security by ensuring the IP address is the same, or is it entirely IP address based? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|