How to inplement Session in CGI

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sullivan WxPyQtKinter

    #1

    How to inplement Session in CGI

    Python disappointly failed to provide a convinient cgi session
    management module. Not willing to use external modules, I would like to
    implement a simplest Session object on my own.

    The basic problem is: how could a python CGI program understand several
    requests are in the same session? Definately, request from different IP
    would be easy to identified to be in different sessions, but request
    from the same IP would not.

    Anyone has any idea?
    Thank you:-)

  • bruno at modulix

    #2
    Re: How to inplement Session in CGI

    Sullivan WxPyQtKinter wrote:[color=blue]
    > Python disappointly failed to provide a convinient cgi session
    > management module.[/color]

    Probably because there are much better options for web programming in
    Python ?
    [color=blue]
    > Not willing to use external modules, I would like to
    > implement a simplest Session object on my own.
    >
    > The basic problem is: how could a python CGI program understand several
    > requests are in the same session?[/color]

    Just like anyone else: by setting a session cookie. This is not related
    to CGI, it's just how HTTP works.

    --
    bruno desthuilliers
    python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    p in 'onurb@xiludom. gro'.split('@')])"

    Comment

    • Piet van Oostrum

      #3
      Re: How to inplement Session in CGI

      >>>>> "Sullivan WxPyQtKinter" <sullivanz.pku@ gmail.com> (SW) wrote:
      [color=blue]
      >SW> Python disappointly failed to provide a convinient cgi session
      >SW> management module. Not willing to use external modules, I would like to
      >SW> implement a simplest Session object on my own.[/color]
      [color=blue]
      >SW> The basic problem is: how could a python CGI program understand several
      >SW> requests are in the same session? Definately, request from different IP
      >SW> would be easy to identified to be in different sessions, but request
      >SW> from the same IP would not.[/color]


      or google for python cgi session for more.
      But why write it yourself if someone else has already done the work?
      --
      Piet van Oostrum <piet@cs.uu.n l>
      URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C 4]
      Private email: piet@vanoostrum .org

      Comment

      • Peter Hansen

        #4
        Re: How to inplement Session in CGI

        Sullivan WxPyQtKinter wrote:[color=blue]
        > Python disappointly failed to provide a convinient cgi session
        > management module. Not willing to use external modules, I would like to
        > implement a simplest Session object on my own.
        >
        > The basic problem is: how could a python CGI program understand several
        > requests are in the same session? Definately, request from different IP
        > would be easy to identified to be in different sessions, but request
        > from the same IP would not.
        >
        > Anyone has any idea?[/color]

        Maybe you could get over your irrational fear of external modules just
        long enough to download one or two and examine them, to learn how they
        do it. Then you could answer your own question...

        Comment

        • Sullivan WxPyQtKinter

          #5
          Re: How to inplement Session in CGI


          bruno at modulix 写道:
          [color=blue]
          > Sullivan WxPyQtKinter wrote:[color=green]
          > > Python disappointly failed to provide a convinient cgi session
          > > management module.[/color]
          >
          > Probably because there are much better options for web programming in
          > Python ?
          > [/color]
          Really? Then what is it?

          Comment

          • bruno at modulix

            #6
            Re: How to inplement Session in CGI

            Sullivan WxPyQtKinter wrote:[color=blue]
            > bruno at modulix 写道:
            >
            >[color=green]
            >>Sullivan WxPyQtKinter wrote:
            >>[color=darkred]
            >>>Python disappointly failed to provide a convinient cgi session
            >>>management module.[/color]
            >>
            >>Probably because there are much better options for web programming in
            >>Python ?
            >>[/color]
            >
            > Really? Then what is it?[/color]

            Please notice the 's' at the end of 'options'. For a quick and
            incomplete overview, you can start here:




            --
            bruno desthuilliers
            python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
            p in 'onurb@xiludom. gro'.split('@')])"

            Comment

            Working...