2007年10月16日 星期二 09:28
º¹, һССÐÄ, ½«ÖÐÎÄÏûÏ¢·¢µ½ÁËwebpy×é. Òª±»BSÁË. ---------- Forwarded message ---------- From: ´óÀÉ <iexper在gmail.com> Date: Oct 16, 2007 9:14 AM Subject: [webpy] ¹ØÓÚcookieµÄÓ÷¨ To: webpy在googlegroups.com # дcookie web.setcookie('username', author.name) web.setcookie('password', author.password) # ȡcookie username = web.cookies('username')['username'] password = web.cookies('password')['password'] ÔÚÎҵIJâÊÔÖÐ web.cookies('username')['username'] == web.cookies ('password')['username'] -- ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... Gtalk: iexper(at)gmail.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups " web.py" group. To post to this group, send email to webpy在googlegroups.com To unsubscribe from this group, send email to webpy-unsubscribe在googlegroups.com For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~--- -- ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... Gtalk: iexper(at)gmail.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/0306c887/attachment.html
2007年10月16日 星期二 09:33
你不会是把密码明文放 cookie 里了吧…… 在 07-10-16,大郎<iexper at gmail.com> 写道: > > # 写cookie > web.setcookie('username', author.name) > web.setcookie('password', author.password) > > # 取cookie > username = web.cookies('username')['username'] > password = web.cookies('password')['password'] > > 在我的测试中 > web.cookies('username')['username'] == > web.cookies('password')['username'] > > -- > 每个人都有一片属于自己的森林, 迷失的人迷失了, 相逢的还会再相逢... > Gtalk: iexper(at)gmail.com > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups > "web.py" group. > To post to this group, send email to webpy at googlegroups.com > To unsubscribe from this group, send email to > webpy-unsubscribe at googlegroups.com > For more options, visit this group at > http://groups.google.com/group/webpy?hl=en > -~----------~----~----~----~------~----~------~--~--- > > > > -- > 每个人都有一片属于自己的森林, 迷失的人迷失了, 相逢的还会再相逢... > Gtalk: iexper(at)gmail.com > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > -- Hiweed-Debian pgpkey: http://pgp.mit.edu:11371/pks/lookup?op=get&search;=0x5B6F0C29
2007年10月16日 星期二 09:34
»¹Î´ÔÚdjango×éÖмû¹ý..ÖÐÎÄ¡. _____ ·¢¼þÈË: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn] ´ú±í ´óÀÉ ·¢ËÍʱ¼ä: 2007Äê10ÔÂ16ÈÕ 9:29 ÊÕ¼þÈË: python-chinese在lists.python.cn Ö÷Ìâ: [python-chinese] [webpy] ¹ØÓÚcookieµÄÓ÷¨ º¹, һССÐÄ, ½«ÖÐÎÄÏûÏ¢·¢µ½ÁËwebpy×é. Òª±»BSÁË. ---------- Forwarded message ---------- From: ´óÀÉ <iexper在gmail.com> Date: Oct 16, 2007 9:14 AM Subject: [webpy] ¹ØÓÚcookieµÄÓ÷¨ To: webpy在googlegroups.com # дcookie web.setcookie('username', author.name) web.setcookie('password', author.password) # ȡcookie username = web.cookies('username')['username'] password = web.cookies('password')['password'] ÔÚÎҵIJâÊÔÖÐ web.cookies('username')['username'] == web.cookies('password')['username'] -- ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... Gtalk: iexper(at)gmail.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to webpy在googlegroups.com To unsubscribe from this group, send email to webpy-unsubscribe在googlegroups.com For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~--- -- ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... Gtalk: iexper(at)gmail.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/1113d057/attachment.html
2007年10月16日 星期二 09:38
md5¼ÓÃÜ. On 10/16/07, Jiahua Huang <jhuangjiahua在gmail.com> wrote: > > Äã²»»áÊÇ°ÑÃÜÂëÃ÷ÎÄ·Å cookie ÀïÁË°É¡¡ > > ÔÚ 07-10-16£¬´óÀÉ<iexper在gmail.com> дµÀ£º > > > > # дcookie > > web.setcookie('username', author.name) > > web.setcookie('password', author.password) > > > > # ȡcookie > > username = web.cookies('username')['username'] > > password = web.cookies('password')['password'] > > > > ÔÚÎҵIJâÊÔÖÐ > > web.cookies('username')['username'] == > > web.cookies('password')['username'] > > > > -- > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > Gtalk: iexper(at)gmail.com > > --~--~---------~--~----~------------~-------~--~----~ > > You received this message because you are subscribed to the Google > Groups > > "web.py" group. > > To post to this group, send email to webpy在googlegroups.com > > To unsubscribe from this group, send email to > > webpy-unsubscribe在googlegroups.com > > For more options, visit this group at > > http://groups.google.com/group/webpy?hl=en > > -~----------~----~----~----~------~----~------~--~--- > > > > > > > > -- > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > Gtalk: iexper(at)gmail.com > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > -- > Hiweed-Debian > pgpkey: http://pgp.mit.edu:11371/pks/lookup?op=get&search;=0x5B6F0C29 > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... Gtalk: iexper(at)gmail.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/59bff2f5/attachment.html
2007年10月16日 星期二 09:42
Ò»°ãÒ²²»»á°ÑÃÜÂë·ÅcookieÀï°É ¼´Ê¹ÊǼÓÃܹýµÄ¡£ On 10/16/07, ´óÀÉ <iexper在gmail.com> wrote: > > md5¼ÓÃÜ. > > On 10/16/07, Jiahua Huang <jhuangjiahua在gmail.com> wrote: > > > > Äã²»»áÊÇ°ÑÃÜÂëÃ÷ÎÄ·Å cookie ÀïÁË°É¡¡ > > > > ÔÚ 07-10-16£¬´óÀÉ<iexper在gmail.com> дµÀ£º > > > > > > # дcookie > > > web.setcookie('username', author.name ) > > > web.setcookie('password', author.password) > > > > > > # ȡcookie > > > username = web.cookies('username')['username'] > > > password = web.cookies('password')['password'] > > > > > > ÔÚÎҵIJâÊÔÖÐ > > > web.cookies('username')['username'] == > > > web.cookies('password')['username'] > > > > > > -- > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > Gtalk: iexper(at)gmail.com > > > --~--~---------~--~----~------------~-------~--~----~ > > > You received this message because you are subscribed to the Google > > Groups > > > "web.py" group. > > > To post to this group, send email to webpy在googlegroups.com > > > To unsubscribe from this group, send email to > > > webpy-unsubscribe在googlegroups.com > > > For more options, visit this group at > > > http://groups.google.com/group/webpy?hl=en > > > -~----------~----~----~----~------~----~------~--~--- > > > > > > > > > > > > -- > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > Gtalk: iexper(at)gmail.com > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to > > > python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request在lists.python.cn > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > -- > > Hiweed-Debian > > pgpkey: http://pgp.mit.edu:11371/pks/lookup?op=get&search;=0x5B6F0C29 > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > -- > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > Gtalk: iexper(at)gmail.com > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/7d4f8322/attachment.htm
2007年10月16日 星期二 09:52
ÄÇÇë½Ì@@ͬѧµÄÓû§µÇ¼ÊÇ·ñÒѵǼµÄÑéÖ¤·½Ê½ :) On 10/16/07, @@ <askfor在gmail.com> wrote: > > Ò»°ãÒ²²»»á°ÑÃÜÂë·ÅcookieÀï°É ¼´Ê¹ÊǼÓÃܹýµÄ¡£ > > On 10/16/07, ´óÀÉ <iexper在gmail.com> wrote: > > > > md5¼ÓÃÜ. > > > > On 10/16/07, Jiahua Huang <jhuangjiahua在gmail.com > wrote: > > > > > > Äã²»»áÊÇ°ÑÃÜÂëÃ÷ÎÄ·Å cookie ÀïÁË°É¡¡ > > > > > > ÔÚ 07-10-16£¬´óÀÉ< iexper在gmail.com> дµÀ£º > > > > > > > > # дcookie > > > > web.setcookie('username', author.name ) > > > > web.setcookie('password', author.password) > > > > > > > > # ȡcookie > > > > username = web.cookies('username')['username'] > > > > password = web.cookies('password')['password'] > > > > > > > > ÔÚÎҵIJâÊÔÖÐ > > > > web.cookies('username')['username'] == > > > > web.cookies('password')['username'] > > > > > > > > -- > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > Gtalk: iexper(at)gmail.com > > > > --~--~---------~--~----~------------~-------~--~----~ > > > > You received this message because you are subscribed to the Google > > > Groups > > > > "web.py" group. > > > > To post to this group, send email to webpy在googlegroups.com > > > > To unsubscribe from this group, send email to > > > > webpy-unsubscribe在googlegroups.com > > > > For more options, visit this group at > > > > http://groups.google.com/group/webpy?hl=en > > > > -~----------~----~----~----~------~----~------~--~--- > > > > > > > > > > > > > > > > -- > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > Gtalk: iexper(at)gmail.com > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to > > > > python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request在lists.python.cn > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > -- > > > Hiweed-Debian > > > pgpkey: http://pgp.mit.edu:11371/pks/lookup?op=get&search;=0x5B6F0C29 > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > -- > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > Gtalk: iexper(at)gmail.com > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... Gtalk: iexper(at)gmail.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/79a450d8/attachment.html
2007年10月16日 星期二 10:09
Ò»°ãÊÇsession+cookieÒ»ÆðÑéÖ¤°É cookie¼Ç¼Óû§Ãû È»ºóÔÚsessionÀï²éÕâ¸öÓû§Ãû ÕâÑùÀ´ÅжÏÓû§ÊÇ·ñµÇ¼ÁË¡£ On 10/16/07, ´óÀÉ <iexper在gmail.com> wrote: > > ÄÇÇë½Ì@@ͬѧµÄÓû§µÇ¼ÊÇ·ñÒѵǼµÄÑéÖ¤·½Ê½ :) > > On 10/16/07, @@ <askfor在gmail.com> wrote: > > > Ò»°ãÒ²²»»á°ÑÃÜÂë·ÅcookieÀï°É ¼´Ê¹ÊǼÓÃܹýµÄ¡£ > > > > On 10/16/07, ´óÀÉ <iexper在gmail.com > wrote: > > > > > > md5¼ÓÃÜ. > > > > > > On 10/16/07, Jiahua Huang <jhuangjiahua在gmail.com > wrote: > > > > > > > > Äã²»»áÊÇ°ÑÃÜÂëÃ÷ÎÄ·Å cookie ÀïÁË°É¡¡ > > > > > > > > ÔÚ 07-10-16£¬´óÀÉ< iexper在gmail.com> дµÀ£º > > > > > > > > > > # дcookie > > > > > web.setcookie('username', author.name ) > > > > > web.setcookie('password', author.password) > > > > > > > > > > # ȡcookie > > > > > username = web.cookies('username')['username'] > > > > > password = web.cookies('password')['password'] > > > > > > > > > > ÔÚÎҵIJâÊÔÖÐ > > > > > web.cookies('username')['username'] == > > > > > web.cookies('password')['username'] > > > > > > > > > > -- > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > Gtalk: iexper(at)gmail.com > > > > > --~--~---------~--~----~------------~-------~--~----~ > > > > > You received this message because you are subscribed to the > > > > Google Groups > > > > > "web.py" group. > > > > > To post to this group, send email to webpy在googlegroups.com > > > > > To unsubscribe from this group, send email to > > > > > webpy-unsubscribe在googlegroups.com > > > > > For more options, visit this group at > > > > > http://groups.google.com/group/webpy?hl=en > > > > > -~----------~----~----~----~------~----~------~--~--- > > > > > > > > > > > > > > > > > > > > -- > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > Gtalk: iexper(at)gmail.com > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese在lists.python.cn > > > > > Subscribe: send subscribe to > > > > > python-chinese-request在lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request在lists.python.cn > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > -- > > > > Hiweed-Debian > > > > pgpkey: http://pgp.mit.edu:11371/pks/lookup?op=get&search;=0x5B6F0C29 > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request在lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > -- > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > Gtalk: iexper(at)gmail.com > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > Gtalk: iexper(at)gmail.com > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/3aedd6e4/attachment.htm
2007年10月16日 星期二 10:12
ÔÚwebpy×éµÃµ½µÄ»Ø¸´ ÊÇÕâÑùµÄ: hen calling web.cookies(), positional arguments signify cookie keys that are required. (That is, it will raise an exception if one is not found, but it has no effect on keys that are indeed present.) Normally you'd do something like `c = web.cookies()` and then just access c['username'] and c['password'] as needed. On 10/16/07, ´óÀÉ <iexper在gmail.com> wrote: > > ÄÇÇë½Ì@@ͬѧµÄÓû§µÇ¼ÊÇ·ñÒѵǼµÄÑéÖ¤·½Ê½ :) > > On 10/16/07, @@ <askfor在gmail.com> wrote: > > > Ò»°ãÒ²²»»á°ÑÃÜÂë·ÅcookieÀï°É ¼´Ê¹ÊǼÓÃܹýµÄ¡£ > > > > On 10/16/07, ´óÀÉ <iexper在gmail.com > wrote: > > > > > > md5¼ÓÃÜ. > > > > > > On 10/16/07, Jiahua Huang <jhuangjiahua在gmail.com > wrote: > > > > > > > > Äã²»»áÊÇ°ÑÃÜÂëÃ÷ÎÄ·Å cookie ÀïÁË°É¡¡ > > > > > > > > ÔÚ 07-10-16£¬´óÀÉ< iexper在gmail.com> дµÀ£º > > > > > > > > > > # дcookie > > > > > web.setcookie('username', author.name ) > > > > > web.setcookie('password', author.password) > > > > > > > > > > # ȡcookie > > > > > username = web.cookies('username')['username'] > > > > > password = web.cookies('password')['password'] > > > > > > > > > > ÔÚÎҵIJâÊÔÖÐ > > > > > web.cookies('username')['username'] == > > > > > web.cookies('password')['username'] > > > > > > > > > > -- > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > Gtalk: iexper(at)gmail.com > > > > > --~--~---------~--~----~------------~-------~--~----~ > > > > > You received this message because you are subscribed to the > > > > Google Groups > > > > > "web.py" group. > > > > > To post to this group, send email to webpy在googlegroups.com > > > > > To unsubscribe from this group, send email to > > > > > webpy-unsubscribe在googlegroups.com > > > > > For more options, visit this group at > > > > > http://groups.google.com/group/webpy?hl=en > > > > > -~----------~----~----~----~------~----~------~--~--- > > > > > > > > > > > > > > > > > > > > -- > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > Gtalk: iexper(at)gmail.com > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese在lists.python.cn > > > > > Subscribe: send subscribe to > > > > > python-chinese-request在lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request在lists.python.cn > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > -- > > > > Hiweed-Debian > > > > pgpkey: http://pgp.mit.edu:11371/pks/lookup?op=get&search;=0x5B6F0C29 > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request在lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > -- > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > Gtalk: iexper(at)gmail.com > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > Gtalk: iexper(at)gmail.com > -- ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... Gtalk: iexper(at)gmail.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/82fc658e/attachment.html
2007年10月16日 星期二 10:13
取 cookie 的方式是错误的 应该用 web.cookies().username or web.cookies().password 或者 web.cookies()['username'] 都可以 在 webpy 里面,自定义了 storage 这个数据类型,可以认为是 dict 的一个扩展. web.cookie() 的参数的作用增加缺省值. 比如 web.cookies(username='ken').username 假如 cookie 里面已经有了 username 这个 cookie,那么则返回该值,否则返回 'ken' 这样的用户可以保证该表达式总是有合法的值。而不是 if not ... else 一行表达式就搞定. > # 取cookie > username = web.cookies('username')['username'] > password = web.cookies('password')['password'] > >
2007年10月16日 星期二 10:17
ÔÚcookieÖÐαÔìÒ»¸öÓû§ÃûÏ൱ÈÝÒ×µØ˵. :) ÄãÊÇ˵½«ÃÜÂëÐÅÏ¢´æ´¢ÔÚsessionµ±ÖÐ? ¶ø¾ÝÎÒËùÖªsessionµÄÉúÃüÖÜÆÚ¶¼Ï൱¶ÌµØ˵.ËäÈ»¿ÉÒÔ×Ô¼ºÉèÖÃ, µ«seesionËƺõ²»ÊÇÓÃ×÷ÕâÑùµØ? ... On 10/16/07, @@ <askfor在gmail.com> wrote: > > Ò»°ãÊÇsession+cookieÒ»ÆðÑéÖ¤°É > cookie¼Ç¼Óû§Ãû È»ºóÔÚsessionÀï²éÕâ¸öÓû§Ãû ÕâÑùÀ´ÅжÏÓû§ÊÇ·ñµÇ¼ÁË¡£ > > > On 10/16/07, ´óÀÉ <iexper在gmail.com> wrote: > > > ÄÇÇë½Ì@@ͬѧµÄÓû§µÇ¼ÊÇ·ñÒѵǼµÄÑéÖ¤·½Ê½ :) > > > > On 10/16/07, @@ < askfor在gmail.com> wrote: > > > > > Ò»°ãÒ²²»»á°ÑÃÜÂë·ÅcookieÀï°É ¼´Ê¹ÊǼÓÃܹýµÄ¡£ > > > > > > On 10/16/07, ´óÀÉ <iexper在gmail.com > wrote: > > > > > > > > md5¼ÓÃÜ. > > > > > > > > On 10/16/07, Jiahua Huang <jhuangjiahua在gmail.com > wrote: > > > > > > > > > > Äã²»»áÊÇ°ÑÃÜÂëÃ÷ÎÄ·Å cookie ÀïÁË°É¡¡ > > > > > > > > > > ÔÚ 07-10-16£¬´óÀÉ< iexper在gmail.com> дµÀ£º > > > > > > > > > > > > # дcookie > > > > > > web.setcookie('username', author.name ) > > > > > > web.setcookie('password', author.password) > > > > > > > > > > > > # ȡcookie > > > > > > username = web.cookies('username')['username'] > > > > > > password = web.cookies('password')['password'] > > > > > > > > > > > > ÔÚÎҵIJâÊÔÖÐ > > > > > > web.cookies('username')['username'] == > > > > > > web.cookies('password')['username'] > > > > > > > > > > > > -- > > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > > Gtalk: iexper(at)gmail.com > > > > > > --~--~---------~--~----~------------~-------~--~----~ > > > > > > You received this message because you are subscribed to the > > > > > Google Groups > > > > > > "web.py" group. > > > > > > To post to this group, send email to webpy在googlegroups.com > > > > > > To unsubscribe from this group, send email to > > > > > > webpy-unsubscribe在googlegroups.com > > > > > > For more options, visit this group at > > > > > > http://groups.google.com/group/webpy?hl=en > > > > > > -~----------~----~----~----~------~----~------~--~--- > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > > Gtalk: iexper(at)gmail.com > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese在lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request在lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request在lists.python.cn > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > -- > > > > > Hiweed-Debian > > > > > pgpkey: > > > > > http://pgp.mit.edu:11371/pks/lookup?op=get&search;=0x5B6F0C29 > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese在lists.python.cn > > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request在lists.python.cn > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > -- > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > Gtalk: iexper(at)gmail.com > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request在lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > -- > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > Gtalk: iexper(at)gmail.com > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... Gtalk: iexper(at)gmail.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/8ae9a93c/attachment.htm
2007年10月16日 星期二 10:24
使用 webpy,不可不了解 Storage 。 web.input() 的用法也是这样的.
2007年10月16日 星期二 10:30
给他贴个示例得了。 在 07-10-16,@@<askfor at gmail.com> 写道: > 一般是session+cookie一起验证吧 > cookie记录用户名 然后在session里查这个用户名 这样来判断用户是否登录了。 > > > On 10/16/07, 大郎 <iexper at gmail.com> wrote: > > > > 那请教@@同学的用户登录是否已登录的验证方式 :) > > > >
2007年10月16日 星期二 10:35
±§Ç¸¡£Ó¦¸ÃÊÇÓÃsession¾ÍºÃÁË¡£µÇ¼³É¹¦ºó°ÑÓû§ÐÅÏ¢£¨ÃÜÂëÒ²²»ÓÃдÁË£©Ð´Èësession¡£ ÅжÏʱֻҪ¿´session['username']Äܲ»ÄÜÈ¡µ½¾Í¿ÉÒÔÁË¡£ ²»ÓÃÿ´Î¶¼È¥±È¶ÔÓû§ÃûÊÇ·ñ=ÃÜÂëµÄ¡£ ¸Ð¾õÒ»°ãÓÃÓû§µÇ¼session¾ÍºÃÁË cookieµ¹²»´óÓõ½¡£ On 10/16/07, ´óÀÉ <iexper在gmail.com> wrote: > > ÔÚcookieÖÐαÔìÒ»¸öÓû§ÃûÏ൱ÈÝÒ×µØ˵. :) > ÄãÊÇ˵½«ÃÜÂëÐÅÏ¢´æ´¢ÔÚsessionµ±ÖÐ? ¶ø¾ÝÎÒËùÖªsessionµÄÉúÃüÖÜÆÚ¶¼Ï൱¶ÌµØ˵.ËäÈ»¿ÉÒÔ×Ô¼ºÉèÖÃ, µ«seesionËƺõ²»ÊÇÓÃ×÷ÕâÑùµØ? > ... > > On 10/16/07, @@ < askfor在gmail.com> wrote: > > > Ò»°ãÊÇsession+cookieÒ»ÆðÑéÖ¤°É > > cookie¼Ç¼Óû§Ãû È»ºóÔÚsessionÀï²éÕâ¸öÓû§Ãû ÕâÑùÀ´ÅжÏÓû§ÊÇ·ñµÇ¼ÁË¡£ > > > > > > On 10/16/07, ´óÀÉ < iexper在gmail.com> wrote: > > > > > ÄÇÇë½Ì@@ͬѧµÄÓû§µÇ¼ÊÇ·ñÒѵǼµÄÑéÖ¤·½Ê½ :) > > > > > > On 10/16/07, @@ < askfor在gmail.com> wrote: > > > > > > > Ò»°ãÒ²²»»á°ÑÃÜÂë·ÅcookieÀï°É ¼´Ê¹ÊǼÓÃܹýµÄ¡£ > > > > > > > > On 10/16/07, ´óÀÉ <iexper在gmail.com > wrote: > > > > > > > > > > md5¼ÓÃÜ. > > > > > > > > > > On 10/16/07, Jiahua Huang <jhuangjiahua在gmail.com > wrote: > > > > > > > > > > > > Äã²»»áÊÇ°ÑÃÜÂëÃ÷ÎÄ·Å cookie ÀïÁË°É¡¡ > > > > > > > > > > > > ÔÚ 07-10-16£¬´óÀÉ< iexper在gmail.com> дµÀ£º > > > > > > > > > > > > > > # дcookie > > > > > > > web.setcookie('username', author.name ) > > > > > > > web.setcookie('password', author.password) > > > > > > > > > > > > > > # ȡcookie > > > > > > > username = web.cookies('username')['username'] > > > > > > > password = web.cookies('password')['password'] > > > > > > > > > > > > > > ÔÚÎҵIJâÊÔÖÐ > > > > > > > web.cookies('username')['username'] == > > > > > > > web.cookies('password')['username'] > > > > > > > > > > > > > > -- > > > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > > > Gtalk: iexper(at)gmail.com > > > > > > > --~--~---------~--~----~------------~-------~--~----~ > > > > > > > You received this message because you are subscribed to the > > > > > > Google Groups > > > > > > > "web.py" group. > > > > > > > To post to this group, send email to webpy在googlegroups.com > > > > > > > To unsubscribe from this group, send email to > > > > > > > webpy-unsubscribe在googlegroups.com > > > > > > > For more options, visit this group at > > > > > > > http://groups.google.com/group/webpy?hl=en > > > > > > > -~----------~----~----~----~------~----~------~--~--- > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > > > Gtalk: iexper(at)gmail.com > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese在lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request在lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request在lists.python.cn > > > > > > > Detail Info: > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Hiweed-Debian > > > > > > pgpkey: > > > > > > http://pgp.mit.edu:11371/pks/lookup?op=get&search;=0x5B6F0C29 > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese在lists.python.cn > > > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request在lists.python.cn > > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > Gtalk: iexper(at)gmail.com > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese在lists.python.cn > > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request在lists.python.cn > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request在lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > -- > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > Gtalk: iexper(at)gmail.com > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > Gtalk: iexper(at)gmail.com > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/f60bb73a/attachment.html
2007年10月16日 星期二 10:38
¿ÉÄܼǼsession['user_id']»áºÃµã¡£ On 10/16/07, @@ <askfor在gmail.com> wrote: > > ±§Ç¸¡£Ó¦¸ÃÊÇÓÃsession¾ÍºÃÁË¡£µÇ¼³É¹¦ºó°ÑÓû§ÐÅÏ¢£¨ÃÜÂëÒ²²»ÓÃдÁË£©Ð´Èësession¡£ > > ÅжÏʱֻҪ¿´session['username']Äܲ»ÄÜÈ¡µ½¾Í¿ÉÒÔÁË¡£ > > ²»ÓÃÿ´Î¶¼È¥±È¶ÔÓû§ÃûÊÇ·ñ=ÃÜÂëµÄ¡£ > > ¸Ð¾õÒ»°ãÓÃÓû§µÇ¼session¾ÍºÃÁË cookieµ¹²»´óÓõ½¡£ > > > On 10/16/07, ´óÀÉ <iexper在gmail.com> wrote: > > > ÔÚcookieÖÐαÔìÒ»¸öÓû§ÃûÏ൱ÈÝÒ×µØ˵. :) > > ÄãÊÇ˵½«ÃÜÂëÐÅÏ¢´æ´¢ÔÚsessionµ±ÖÐ? ¶ø¾ÝÎÒËùÖªsessionµÄÉúÃüÖÜÆÚ¶¼Ï൱¶ÌµØ˵.ËäÈ»¿ÉÒÔ×Ô¼ºÉèÖÃ, > > µ«seesionËƺõ²»ÊÇÓÃ×÷ÕâÑùµØ? ... > > > > On 10/16/07, @@ < askfor在gmail.com> wrote: > > > > > Ò»°ãÊÇsession+cookieÒ»ÆðÑéÖ¤°É > > > cookie¼Ç¼Óû§Ãû È»ºóÔÚsessionÀï²éÕâ¸öÓû§Ãû ÕâÑùÀ´ÅжÏÓû§ÊÇ·ñµÇ¼ÁË¡£ > > > > > > > > > On 10/16/07, ´óÀÉ < iexper在gmail.com> wrote: > > > > > > > ÄÇÇë½Ì@@ͬѧµÄÓû§µÇ¼ÊÇ·ñÒѵǼµÄÑéÖ¤·½Ê½ :) > > > > > > > > On 10/16/07, @@ < askfor在gmail.com> wrote: > > > > > > > > > Ò»°ãÒ²²»»á°ÑÃÜÂë·ÅcookieÀï°É ¼´Ê¹ÊǼÓÃܹýµÄ¡£ > > > > > > > > > > On 10/16/07, ´óÀÉ <iexper在gmail.com > wrote: > > > > > > > > > > > > md5¼ÓÃÜ. > > > > > > > > > > > > On 10/16/07, Jiahua Huang <jhuangjiahua在gmail.com > wrote: > > > > > > > > > > > > > > Äã²»»áÊÇ°ÑÃÜÂëÃ÷ÎÄ·Å cookie ÀïÁË°É¡¡ > > > > > > > > > > > > > > ÔÚ 07-10-16£¬´óÀÉ< iexper在gmail.com> дµÀ£º > > > > > > > > > > > > > > > > # дcookie > > > > > > > > web.setcookie('username', author.name ) > > > > > > > > web.setcookie('password', author.password) > > > > > > > > > > > > > > > > # ȡcookie > > > > > > > > username = web.cookies('username')['username'] > > > > > > > > password = web.cookies('password')['password'] > > > > > > > > > > > > > > > > ÔÚÎҵIJâÊÔÖÐ > > > > > > > > web.cookies('username')['username'] == > > > > > > > > web.cookies('password')['username'] > > > > > > > > > > > > > > > > -- > > > > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > > > > Gtalk: iexper(at)gmail.com > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ > > > > > > > > You received this message because you are subscribed to the > > > > > > > Google Groups > > > > > > > > "web.py" group. > > > > > > > > To post to this group, send email to webpy在googlegroups.com > > > > > > > > To unsubscribe from this group, send email to > > > > > > > > webpy-unsubscribe在googlegroups.com > > > > > > > > For more options, visit this group at > > > > > > > > http://groups.google.com/group/webpy?hl=en > > > > > > > > -~----------~----~----~----~------~----~------~--~--- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > > > > Gtalk: iexper(at)gmail.com > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese在lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > > python-chinese-request在lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > python-chinese-request在lists.python.cn > > > > > > > > Detail Info: > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > Hiweed-Debian > > > > > > > pgpkey: > > > > > > > http://pgp.mit.edu:11371/pks/lookup?op=get&search;=0x5B6F0C29 > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese在lists.python.cn > > > > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request在lists.python.cn > > > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > > > Gtalk: iexper(at)gmail.com > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese在lists.python.cn > > > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request在lists.python.cn > > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese在lists.python.cn > > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request在lists.python.cn > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > -- > > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > > > Gtalk: iexper(at)gmail.com > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > -- > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > > Gtalk: iexper(at)gmail.com > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/d5919d67/attachment.htm
2007年10月16日 星期二 10:39
webpy 的 session 有三种实现方式: 服务器端文件存储 服务器端数据库存储 cookie 存储 创建 session 的时候可以指定生命期 (max_age) PHP session 缺省实现也是文件的,一般的应用这种模式足够了;但文件session的问题是 web server 分布(除非用 nfs 共享 session 目录) 数据库能解决 web server 分布的问题 cookie模式能最大化的减少磁盘IO,但安全性很成问题 不知道未来会不会有 memcached 的支持. 见:http://webpy.org/sessions 如果想用 session 支持现在只能自己去 bzr 分支 webpy 0.3 将加入 在 07-10-16,大郎<iexper at gmail.com> 写道: > 在cookie中伪造一个用户名相当容易地说. :) > 你是说将密码信息存储在session当中? 而据我所知session的生命周期都相当短地说.虽然可以自己设置, > 但seesion似乎不是用作这样地? ...
2007年10月16日 星期二 10:51
¸Ð¾õûÌرðÐèÇó»¹ÊÇÓÃÎļþºÃÁË¡£ ÒÔÇ°×Ô¼ºµÄÍøÕ¾ÓõÄmysql£¬sessionдÔÚÊý¾Ý¿âÀï¡£·ÃÎÊÁ¿´óµÄʱºò³£³öÏּǼsession±íµÄindex»µµô¡£ On 10/16/07, Yingbo Qiu <qiuyingbo在gmail.com> wrote: > > webpy µÄ session ÓÐÈýÖÖʵÏÖ·½Ê½£º > > ·þÎñÆ÷¶ËÎļþ´æ´¢ > ·þÎñÆ÷¶ËÊý¾Ý¿â´æ´¢ > cookie ´æ´¢ > > ´´½¨ session µÄʱºò¿ÉÒÔÖ¸¶¨ÉúÃüÆÚ (max_age) > > PHP session ȱʡʵÏÖÒ²ÊÇÎļþµÄ£¬Ò»°ãµÄÓ¦ÓÃÕâÖÖģʽ×ã¹»ÁË£»µ«ÎļþsessionµÄÎÊÌâÊÇ web server ·Ö²¼£¨³ý·ÇÓà > nfs ¹²Ïí session Ŀ¼£© > Êý¾Ý¿âÄܽâ¾ö web server ·Ö²¼µÄÎÊÌâ > cookieģʽÄÜ×î´ó»¯µÄ¼õÉÙ´ÅÅÌIO£¬µ«°²È«ÐԺܳÉÎÊÌâ > > ²»ÖªµÀδÀ´»á²»»áÓÐ memcached µÄÖ§³Ö. > > ¼û£ºhttp://webpy.org/sessions > Èç¹ûÏëÓà session Ö§³ÖÏÖÔÚÖ»ÄÜ×Ô¼ºÈ¥ bzr ·ÖÖ§ > webpy 0.3 ½«¼ÓÈë > > ÔÚ 07-10-16£¬´óÀÉ<iexper在gmail.com> дµÀ£º > > ÔÚcookieÖÐαÔìÒ»¸öÓû§ÃûÏ൱ÈÝÒ×µØ˵. :) > > ÄãÊÇ˵½«ÃÜÂëÐÅÏ¢´æ´¢ÔÚsessionµ±ÖÐ? ¶ø¾ÝÎÒËùÖªsessionµÄÉúÃüÖÜÆÚ¶¼Ï൱¶ÌµØ˵.ËäÈ»¿ÉÒÔ×Ô¼ºÉèÖÃ, > > µ«seesionËƺõ²»ÊÇÓÃ×÷ÕâÑùµØ? ... > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071016/b9527b7a/attachment.html
2007年10月17日 星期三 08:56
i tried it like this: # code.py # login... web.setcookie('username', author.name) web.setcookie('password', author.password) ... # logout... del web.cookies().username del web.cookies().password cookieûÓб»Çå³ý, ÇëÎÊÎÒÄÄÀïд´íÁË? On 10/16/07, Yingbo Qiu <qiuyingbo在gmail.com> wrote: > > È¡ cookie µÄ·½Ê½ÊÇ´íÎóµÄ > > Ó¦¸ÃÓà web.cookies().username or web.cookies().password > »òÕß web.cookies()['username'] ¶¼¿ÉÒÔ > > ÔÚ webpy ÀïÃ棬×Ô¶¨ÒåÁË storage Õâ¸öÊý¾ÝÀàÐÍ£¬¿ÉÒÔÈÏΪÊÇ dict µÄÒ»¸öÀ©Õ¹. > > web.cookie() µÄ²ÎÊýµÄ×÷ÓÃÔö¼Óȱʡֵ. > > ±ÈÈç web.cookies(username='ken').username > > ¼ÙÈç cookie ÀïÃæÒѾÓÐÁË username Õâ¸ö cookie£¬ÄÇôÔò·µ»Ø¸ÃÖµ£¬·ñÔò·µ»Ø 'ken' > > ÕâÑùµÄÓû§¿ÉÒÔ±£Ö¤¸Ã±í´ïʽ×ÜÊÇÓкϷ¨µÄÖµ¡£¶ø²»ÊÇ if not ... else > Ò»Ðбí´ïʽ¾Í¸ã¶¨. > > > > # ȡcookie > > username = web.cookies('username')['username'] > > password = web.cookies('password')['password'] > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... Gtalk: iexper(at)gmail.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071017/ce315cd3/attachment.html
2007年10月17日 星期三 09:00
web.setcookie('username', None <http://author.name/>) web.setcookie('password', None) Ó¦¸Ã¾ÍÐÐÁË°É On 10/17/07, ´óÀÉ <iexper在gmail.com> wrote: > > i tried it like this: > # code.py > # login... > web.setcookie('username', author.name) > web.setcookie('password', author.password) > ... > > # logout... > del web.cookies().username > del web.cookies().password > > cookieûÓб»Çå³ý, ÇëÎÊÎÒÄÄÀïд´íÁË? > > On 10/16/07, Yingbo Qiu <qiuyingbo在gmail.com> wrote: > > > > È¡ cookie µÄ·½Ê½ÊÇ´íÎóµÄ > > > > Ó¦¸ÃÓà web.cookies().username or web.cookies().password > > »òÕß web.cookies()['username'] ¶¼¿ÉÒÔ > > > > ÔÚ webpy ÀïÃ棬×Ô¶¨ÒåÁË storage Õâ¸öÊý¾ÝÀàÐÍ£¬¿ÉÒÔÈÏΪÊÇ dict µÄÒ»¸öÀ©Õ¹. > > > > web.cookie() µÄ²ÎÊýµÄ×÷ÓÃÔö¼Óȱʡֵ. > > > > ±ÈÈç web.cookies (username='ken').username > > > > ¼ÙÈç cookie ÀïÃæÒѾÓÐÁË username Õâ¸ö cookie£¬ÄÇôÔò·µ»Ø¸ÃÖµ£¬·ñÔò·µ»Ø 'ken' > > > > ÕâÑùµÄÓû§¿ÉÒÔ±£Ö¤¸Ã±í´ïʽ×ÜÊÇÓкϷ¨µÄÖµ¡£¶ø²»ÊÇ if not ... else > > Ò»Ðбí´ïʽ¾Í¸ã¶¨. > > > > > > > # ȡcookie > > > username = web.cookies ('username')['username'] > > > password = web.cookies('password')['password'] > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > -- > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > Gtalk: iexper(at)gmail.com > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071017/aa6ef8d7/attachment-0001.htm
2007年10月17日 星期三 09:02
晕... del 只是清除 cookie 对象 但浏览器 cookie 还是没有修改的啊. web.setcookie('username', '') web.setcookie('password', '')
2007年10月17日 星期三 09:19
º¹, ÆäʵÎÒÓÐÕâÑù³¢ÊÔ, Ö»ÊÇû³¹µ×¼á³Ö... ÏëÏëÒ²Ã÷°×ѽ, ÖØÉèΪ¿Õֵѽ.¶àлqybͬѧ :) Ó¢ÎÄÁбíÖÐÓÐÅóÓѽ¨ÒéÉèÖÃÉúÃüÖÜÆÚ: eg: web.setcookie('username', '', expires=-1) ÒòΪÒÔÇ°ÔÚ¿´Djangoʱ,ÊÇÓÃdelµÄ, ²úÉúÁË×ÔÈ»ÁªÏë.... On 10/17/07, Yingbo Qiu <qiuyingbo在gmail.com> wrote: > > ÔÎ... del Ö»ÊÇÇå³ý cookie ¶ÔÏó > > µ«ä¯ÀÀÆ÷ cookie »¹ÊÇûÓÐÐ޸ĵİ¡. > web.setcookie('username', '') > web.setcookie('password', '') > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... Gtalk: iexper(at)gmail.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071017/757e3f12/attachment.htm
2007年10月17日 星期三 09:41
djangoµÄÄǸöÊÇsession°¡¡£ On 10/17/07, ´óÀÉ <iexper在gmail.com> wrote: > > º¹, ÆäʵÎÒÓÐÕâÑù³¢ÊÔ, Ö»ÊÇû³¹µ×¼á³Ö... ÏëÏëÒ²Ã÷°×ѽ, ÖØÉèΪ¿Õֵѽ.¶àлqybͬѧ :) Ó¢ÎÄÁбíÖÐÓÐÅóÓѽ¨ÒéÉèÖÃÉúÃüÖÜÆÚ: eg: > web.setcookie('username', '', expires=-1) > > ÒòΪÒÔÇ°ÔÚ¿´Djangoʱ,ÊÇÓÃdelµÄ, ²úÉúÁË×ÔÈ»ÁªÏë.... > > On 10/17/07, Yingbo Qiu <qiuyingbo在gmail.com> wrote: > > > > ÔÎ... del Ö»ÊÇÇå³ý cookie ¶ÔÏó > > > > µ«ä¯ÀÀÆ÷ cookie »¹ÊÇûÓÐÐ޸ĵİ¡. > > web.setcookie('username', '') > > web.setcookie('password', '') > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > -- > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê... > Gtalk: iexper(at)gmail.com > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071017/9612ce9b/attachment.html
Zeuux © 2025
京ICP备05028076号