PyJaipur / PyJudge

Simple Programming Contest hosting software
MIT License
17 stars 29 forks source link

Sessions #122

Closed rishabhKalakoti closed 5 years ago

rishabhKalakoti commented 5 years ago

TODOs

fixes #117

rishabhKalakoti commented 5 years ago

@theSage21 need some help with cookies in python, i checked a few links but can't handle them till now... plz help regarding setting/ deleting/ retriving cookies I tried using http.cookies

theSage21 commented 5 years ago

Ah yes. Cookies are a pain to work with if you don't fully understand them. There are a few things to keep in mind:

  1. cookies are set via response headers
  2. browser can completely ignore them :smile: if it so chooses
  3. cookies have a path. They are sent only for paths which contain that path. Default is the path that set the cookie
  4. they have an age
  5. they are sent only for certain domains

I suggest going through bottle's cookies docs and reading through all the options present there. Might help you understand a little better. In fact, see the code if it's still not clear.

Finally you'll have to do something like:

bottle.response.set_cookie(name, value, path='/')
rishabhKalakoti commented 5 years ago

What else can I add in this one? The ones mentioned in the issue have been handled

theSage21 commented 5 years ago

We can do a single hidden field + show password button or something. I don't like double password entries. 😂

On Thu 16 May, 2019, 14:59 Rishabh Kalakoti, notifications@github.com wrote:

@rishabhKalakoti commented on this pull request.

In views/home.html https://github.com/PyJaipur/PyJudge/pull/122#discussion_r284618977:






  • I would prefer hidden instead of plaintext as it is a password field, your call.

    — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PyJaipur/PyJudge/pull/122?email_source=notifications&email_token=AB2WHUPANK66T3MHIDOBNLTPVUSRHA5CNFSM4HNI6GJKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOBYZ5P5Q#discussion_r284618977, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2WHUNLWODQANVDTYS7GIDPVUSRHANCNFSM4HNI6GJA .

    rishabhKalakoti commented 5 years ago

    I tried something. Let me know if the decorator and message displaying is satisfactory. I kept just one password for now.