You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Jim Gallacher (JIRA)" <ji...@apache.org> on 2005/06/14 04:51:48 UTC

[jira] Created: (MODPYTHON-59) Add get_session() method to request object

Add get_session() method to request object
------------------------------------------

         Key: MODPYTHON-59
         URL: http://issues.apache.org/jira/browse/MODPYTHON-59
     Project: mod_python
        Type: New Feature
  Components: core  
    Versions: 3.2.0    
 Environment: All
    Reporter: Jim Gallacher


Users will get session instances by calling req.get_session(). If a session already exists it will be returned, otherwise a new session instance will be created. Session configuration will be handled using apache directives rather than within their code.

Using this scheme means only one session instance will be created per request, which will eliminate the deadlock problems many people experience. Also, using this scheme makes it possible for sessions to be properly handled within psp pages and across req.internal_redirect() calls.

Code will be commited to svn shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (MODPYTHON-59) Add get_session() method to request object

Posted by Jim Gallacher <jg...@sympatico.ca>.
Graham,

You've hit on a couple of issues I had not considered and I'm trying to 
understand the implications.

Graham Dumpleton (JIRA) wrote:
>     [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=comments#action_12316578 ] 
> 
> Graham Dumpleton commented on MODPYTHON-59:
> -------------------------------------------
> 
> There is a potential issue with the way that PYSID is stored in the
> subprocess_env table and then used to reconstruct the session object
> after an internal redirect.
> 
> I can see two problems here. The first is that if the target of the
> internal redirect is a part of the URL namespace which is under the
> control of a different handler, or where ApplicationPath option was set
> explicitly to be different, the PYSID would potentially override a valid
> pysid for the alternate SID context provided by the browser.

I get your point but is this actually a problem? Since it's an internal 
redirect, the browser will not be aware it is being redirected, so it 
will always send the same PYSID cookie. (Did that sentence make sense?)

Even if the second handler sets a session cookie with a path for URL2, 
the browser will always send the cookie corresponding to URL1.

> The second problem is that an internal redirect could redirect to a
> different part of the URL namespace where the PythonOption for "session"
> is set differently. This could for example result in an instance of
> Session being created initially but an attempt to create a FileSession
> object after the redirect.
> 
> In the second case, if the redirect was to a part of the URL namespace
> notionally under the same ApplicationPath (implicit or explicit), it is
> probably a mistake on the part of the programmer to have specified
> different session types within the same SID context. 

I would consider this to be either a programming error or a 
configuration error.

> It still could occur
> in conjunction with the first case though.
> 
> Is my analysis here correct? Along with PYSID it may be necessary to
> save away the equivalent of the ApplicationPath (implicit or explicit)
> and for the PYSID to be ignored if the target of the internal redirect is
> within a different SID context. It would get harder to protect if there were
> multiple nested applications of internal redirect. Ie., where you end up
> with REDIRECT_PYSID, REDIRECT_REDIRECT_PYSID etc.
> 

As I stated above, I don't think this is an issue, since the browser 
will always send the same cookie. If you think this is not the case 
perhaps you could give a concrete example.

There is a bug in recreating an existing session. I thought I fixed it 
but for some reason the changes never got committed. Currently when a 
session is created with an explicit sid, BaseSession does not add 
Set-Cookie header to headers out. This bug is exposed when the 
get_session tries to recreate the session after a redirect, but is not 
exclusive to it. I'll commit the fix.

Regards,
Jim





[jira] Commented: (MODPYTHON-59) Add get_session() method to request object

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=comments#action_12316578 ] 

Graham Dumpleton commented on MODPYTHON-59:
-------------------------------------------

There is a potential issue with the way that PYSID is stored in the
subprocess_env table and then used to reconstruct the session object
after an internal redirect.

I can see two problems here. The first is that if the target of the
internal redirect is a part of the URL namespace which is under the
control of a different handler, or where ApplicationPath option was set
explicitly to be different, the PYSID would potentially override a valid
pysid for the alternate SID context provided by the browser.

The second problem is that an internal redirect could redirect to a
different part of the URL namespace where the PythonOption for "session"
is set differently. This could for example result in an instance of
Session being created initially but an attempt to create a FileSession
object after the redirect.

In the second case, if the redirect was to a part of the URL namespace
notionally under the same ApplicationPath (implicit or explicit), it is
probably a mistake on the part of the programmer to have specified
different session types within the same SID context. It still could occur
in conjunction with the first case though.

Is my analysis here correct? Along with PYSID it may be necessary to
save away the equivalent of the ApplicationPath (implicit or explicit)
and for the PYSID to be ignored if the target of the internal redirect is
within a different SID context. It would get harder to protect if there were
multiple nested applications of internal redirect. Ie., where you end up
with REDIRECT_PYSID, REDIRECT_REDIRECT_PYSID etc.

> Add get_session() method to request object
> ------------------------------------------
>
>          Key: MODPYTHON-59
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>      Project: mod_python
>         Type: New Feature
>   Components: core
>     Versions: 3.2.0
>  Environment: All
>     Reporter: Jim Gallacher

>
> Users will get session instances by calling req.get_session(). If a session already exists it will be returned, otherwise a new session instance will be created. Session configuration will be handled using apache directives rather than within their code.
> Using this scheme means only one session instance will be created per request, which will eliminate the deadlock problems many people experience. Also, using this scheme makes it possible for sessions to be properly handled within psp pages and across req.internal_redirect() calls.
> Code will be commited to svn shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MODPYTHON-59) Add get_session() method to request object

Posted by "Nicolas Lehuen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]

Nicolas Lehuen updated MODPYTHON-59:
------------------------------------

    Component: session
                   (was: core)

> Add get_session() method to request object
> ------------------------------------------
>
>          Key: MODPYTHON-59
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>      Project: mod_python
>         Type: New Feature
>   Components: session
>     Versions: 3.1.4, 3.1.3, 3.2
>  Environment: All
>     Reporter: Jim Gallacher
>      Fix For: 3.3
>  Attachments: Session.py.diff.txt
>
> Users will get session instances by calling req.get_session(). If a session already exists it will be returned, otherwise a new session instance will be created. Session configuration will be handled using apache directives rather than within their code.
> Using this scheme means only one session instance will be created per request, which will eliminate the deadlock problems many people experience. Also, using this scheme makes it possible for sessions to be properly handled within psp pages and across req.internal_redirect() calls.
> Code will be commited to svn shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MODPYTHON-59) Add get_session() method to request object

Posted by "Jim Gallacher (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]

Jim Gallacher updated MODPYTHON-59:
-----------------------------------

    Version: 3.3.0
                 (was: 3.2.0)

Defering implentation to 3.3.

> Add get_session() method to request object
> ------------------------------------------
>
>          Key: MODPYTHON-59
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>      Project: mod_python
>         Type: New Feature
>   Components: core
>     Versions: 3.3.0
>  Environment: All
>     Reporter: Jim Gallacher

>
> Users will get session instances by calling req.get_session(). If a session already exists it will be returned, otherwise a new session instance will be created. Session configuration will be handled using apache directives rather than within their code.
> Using this scheme means only one session instance will be created per request, which will eliminate the deadlock problems many people experience. Also, using this scheme makes it possible for sessions to be properly handled within psp pages and across req.internal_redirect() calls.
> Code will be commited to svn shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MODPYTHON-59) Add get_session() method to request object

Posted by "Nicolas Lehuen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]

Nicolas Lehuen updated MODPYTHON-59:
------------------------------------

    Fix Version: 3.3.0
        Version: 3.1.4
                 3.1.3
                 3.2.0
                     (was: 3.3.0)

> Add get_session() method to request object
> ------------------------------------------
>
>          Key: MODPYTHON-59
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>      Project: mod_python
>         Type: New Feature
>   Components: core
>     Versions: 3.1.4, 3.1.3, 3.2.0
>  Environment: All
>     Reporter: Jim Gallacher
>      Fix For: 3.3.0
>  Attachments: Session.py.diff.txt
>
> Users will get session instances by calling req.get_session(). If a session already exists it will be returned, otherwise a new session instance will be created. Session configuration will be handled using apache directives rather than within their code.
> Using this scheme means only one session instance will be created per request, which will eliminate the deadlock problems many people experience. Also, using this scheme makes it possible for sessions to be properly handled within psp pages and across req.internal_redirect() calls.
> Code will be commited to svn shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (MODPYTHON-59) Add get_session() method to request object

Posted by Jim Gallacher <jg...@sympatico.ca>.
Graham Dumpleton (JIRA) wrote:
>     [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=comments#action_12316577 ] 
> 
> Graham Dumpleton commented on MODPYTHON-59:
> -------------------------------------------
> 
> I previously commented on this on the mailing list but can't find the
> email to reference.
> 
> The issue I raised was along the line that in order for this scheme to
> be able to work nicely in with other code which creates and manages
> session object, there probably also needs to be a way to determine if
> the session object has already been created and to explicitly set the
> sesssion, thereby bypassing the get_session() method. Ie., I don't
> necessarily believe it should just be a black box whose behaviour
> can't be overridden.
> 
> At minimum, it still should be possible to access the session object as
> req.session and set it by assigning to req.session. Working code set
> for 3.2 still doesn't appear to allow this.
> 
> Wish I could find the email as I may have suggested better reasons
> in it. :-(

I hadn't forgotten - just hadn't got around to it. Spending some 
mod_python time tonight.

Regards,
Jim





[jira] Commented: (MODPYTHON-59) Add get_session() method to request object

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=comments#action_12316577 ] 

Graham Dumpleton commented on MODPYTHON-59:
-------------------------------------------

I previously commented on this on the mailing list but can't find the
email to reference.

The issue I raised was along the line that in order for this scheme to
be able to work nicely in with other code which creates and manages
session object, there probably also needs to be a way to determine if
the session object has already been created and to explicitly set the
sesssion, thereby bypassing the get_session() method. Ie., I don't
necessarily believe it should just be a black box whose behaviour
can't be overridden.

At minimum, it still should be possible to access the session object as
req.session and set it by assigning to req.session. Working code set
for 3.2 still doesn't appear to allow this.

Wish I could find the email as I may have suggested better reasons
in it. :-(

> Add get_session() method to request object
> ------------------------------------------
>
>          Key: MODPYTHON-59
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>      Project: mod_python
>         Type: New Feature
>   Components: core
>     Versions: 3.2.0
>  Environment: All
>     Reporter: Jim Gallacher

>
> Users will get session instances by calling req.get_session(). If a session already exists it will be returned, otherwise a new session instance will be created. Session configuration will be handled using apache directives rather than within their code.
> Using this scheme means only one session instance will be created per request, which will eliminate the deadlock problems many people experience. Also, using this scheme makes it possible for sessions to be properly handled within psp pages and across req.internal_redirect() calls.
> Code will be commited to svn shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MODPYTHON-59) Add get_session() method to request object

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]

Graham Dumpleton updated MODPYTHON-59:
--------------------------------------

    Attachment: Session.py.diff.txt

For posterity, attaching patch for an alternate way of dealing with this problem of locked Session objects and req.internal_redirect(). This actually avoids any changes to the request object itself, with all code changes in Session code. This was presented on developers mailing list. See:

  http://www.mail-archive.com/python-dev@httpd.apache.org/msg00254.html

Experimentation with this idea still needed.

> Add get_session() method to request object
> ------------------------------------------
>
>          Key: MODPYTHON-59
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>      Project: mod_python
>         Type: New Feature
>   Components: core
>     Versions: 3.3.0
>  Environment: All
>     Reporter: Jim Gallacher
>  Attachments: Session.py.diff.txt
>
> Users will get session instances by calling req.get_session(). If a session already exists it will be returned, otherwise a new session instance will be created. Session configuration will be handled using apache directives rather than within their code.
> Using this scheme means only one session instance will be created per request, which will eliminate the deadlock problems many people experience. Also, using this scheme makes it possible for sessions to be properly handled within psp pages and across req.internal_redirect() calls.
> Code will be commited to svn shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MODPYTHON-59) Add get_session() method to request object

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]

Graham Dumpleton updated MODPYTHON-59:
--------------------------------------

    Fix Version/s:     (was: 3.3)

> Add get_session() method to request object
> ------------------------------------------
>
>                 Key: MODPYTHON-59
>                 URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>             Project: mod_python
>          Issue Type: New Feature
>          Components: session
>    Affects Versions: 3.1.4, 3.1.3, 3.2.7
>         Environment: All
>            Reporter: Jim Gallacher
>         Assigned To: Jim Gallacher
>         Attachments: Session.py.diff.txt
>
>
> Users will get session instances by calling req.get_session(). If a session already exists it will be returned, otherwise a new session instance will be created. Session configuration will be handled using apache directives rather than within their code.
> Using this scheme means only one session instance will be created per request, which will eliminate the deadlock problems many people experience. Also, using this scheme makes it possible for sessions to be properly handled within psp pages and across req.internal_redirect() calls.
> Code will be commited to svn shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MODPYTHON-59) Add get_session() method to request object

Posted by "Jim Gallacher (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]

Jim Gallacher closed MODPYTHON-59.
----------------------------------

    Resolution: Won't Fix

General agreement was that the proposed solution for this feature was sub-optimal. The stub for get_session() has been removed from the source.

A new issue should likely be created in the future if another solution to the general problem is found.

> Add get_session() method to request object
> ------------------------------------------
>
>                 Key: MODPYTHON-59
>                 URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>             Project: mod_python
>          Issue Type: New Feature
>          Components: session
>    Affects Versions: 3.1.4, 3.1.3, 3.2.7
>         Environment: All
>            Reporter: Jim Gallacher
>         Assigned To: Jim Gallacher
>         Attachments: Session.py.diff.txt
>
>
> Users will get session instances by calling req.get_session(). If a session already exists it will be returned, otherwise a new session instance will be created. Session configuration will be handled using apache directives rather than within their code.
> Using this scheme means only one session instance will be created per request, which will eliminate the deadlock problems many people experience. Also, using this scheme makes it possible for sessions to be properly handled within psp pages and across req.internal_redirect() calls.
> Code will be commited to svn shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: get_session(), req.session, req.form and MODPYTHON-38

Posted by "Gregory (Grisha) Trubetskoy" <gr...@apache.org>.
On Mon, 13 Mar 2006, Graham Dumpleton wrote:

> Thus I want a documented convention that if a handler is going to use
> util.FieldStorage, that it should before doing so, first check whether
> an existing instance resides as req.form and use that instead.

I'm not sure if this is a good example - req.form is something specific to 
the publisher. Rather than perhaps documenting it as you suggest, 
util.FieldStorage can take it upon itself to create a req.form so that 
subsequent attempts to instantiate it just return req.form. (This is just 
an example, I'm not 100% sure that I having FS do this makes sense - seems 
like a good idea).

> Similarly, if a handler is going to create a Session object, that it
> look for an existing instance as req.session and again use that instead.

OR, the Session module would know to look for a req.session, in which case 
the handlers wouldn't need to worry about it.

(One thing to watch out for would be that mutliple concurrent sessions in 
the same request is a possibility)

Grisha

get_session(), req.session, req.form and MODPYTHON-38

Posted by Graham Dumpleton <gr...@dscpl.com.au>.
That get_session() was being added at the C code level was also one of
the things that worried me about this change. Thus in part why my
suggestion for an alternate approach didn't touch the request object
at all.

While we are talking about this issue of additions to the request 
object,
the documentation says:

   The request object is a Python mapping to the Apache request_rec 
structure.
   When a handler is invoked, it is always passed a single argument - 
the request object.

   You can dynamically assign attributes to it as a way to communicate 
between handlers.

The bit I want to highlight is the last line about handlers dynamically
assigning attributes to the request object.

Being able to do this is quite useful and is already used within
mod_python.publisher. Specifically, it assigns the instance of the
FieldStorage object to req.form. This can then be accessed by the
published function.

As I describe in:

   https://issues.apache.org/jira/browse/MODPYTHON-38

I want to formalise a couple of current conventions regarding attributes
being assigned to the request object by handlers. I have mentioned 
req.form.
The other I want to formalise is req.session.

Thus I want a documented convention that if a handler is going to use
util.FieldStorage, that it should before doing so, first check whether
an existing instance resides as req.form and use that instead.

Similarly, if a handler is going to create a Session object, that it
look for an existing instance as req.session and again use that instead.

Both mod_python.psp and mod_python.publisher would be modified to follow
the convention, which would then avoid the problems which sometimes
come up when people try and use the two together. Ie., both trying to
parse form arguments, or both trying to create session objects and
locking each other out.

Is there support for doing this? If so I'll up it on my priority list.

Note, this isn't addressing some of what the get_session() changes
were intended to address, specifically issues of internal redirects,
but I think it is a good start to at least address this, with any
final solution building around this convention.

Graham

On 13/03/2006, at 2:39 PM, Gregory (Grisha) Trubetskoy wrote:

>
> I'm -1 on get_session() too. The request object is supposed to be a 
> representation of Apache's request, and get_session() just does not 
> belong there.
>
> Grisha
>
> On Sun, 12 Mar 2006, Jim Gallacher wrote:
>
>> I handn't really intended to start working on an implementation. I 
>> just don't like seeing all those issues in JIRA marked as unassigned. 
>> :) Since I created it I figured I should take some responsibility for 
>> it. Plus, it's a gentle reminder when I list my assigned issues - 
>> resolve it one way or another.
>>
>> I still think we need some sort of solution to the problem of people 
>> trying to create 2 session instances in the same request, but I agree 
>> that the original concept of req.get_session() was not quite right.
>>
>> Jim
>>
>> Graham Dumpleton wrote:
>>> I would rather we not go ahead with adding req.get_session() at
>>> this time. At least not how it was envisaged to be done previously.
>>> I'll come back with a bit of analysis after I review where we were
>>> up to previously.
>>> Graham
>>> On 12/03/2006, at 8:47 AM, Jim Gallacher (JIRA) wrote:
>>>>      [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]
>>>> Jim Gallacher reassigned MODPYTHON-59:
>>>> --------------------------------------
>>>>     Assign To: Jim Gallacher
>>>>> Add get_session() method to request object
>>>>> ------------------------------------------
>>>>>          Key: MODPYTHON-59
>>>>>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>>>>>      Project: mod_python
>>>>>         Type: New Feature
>>>>>   Components: session
>>>>>     Versions: 3.1.4, 3.1.3, 3.2.7
>>>>>  Environment: All
>>>>>     Reporter: Jim Gallacher
>>>>>     Assignee: Jim Gallacher
>>>>>      Fix For: 3.3
>>>>>  Attachments: Session.py.diff.txt
>>>>> Users will get session instances by calling req.get_session(). If 
>>>>> a session already exists it will be returned, otherwise a new 
>>>>> session instance will be created. Session configuration will be 
>>>>> handled using apache directives rather than within their code.
>>>>> Using this scheme means only one session instance will be created 
>>>>> per request, which will eliminate the deadlock problems many 
>>>>> people experience. Also, using this scheme makes it possible for 
>>>>> sessions to be properly handled within psp pages and across 
>>>>> req.internal_redirect() calls.
>>>>> Code will be commited to svn shortly.
>>>> -- 
>>>> This message is automatically generated by JIRA.
>>>> -
>>>> If you think it was sent incorrectly contact one of the 
>>>> administrators:
>>>>    http://issues.apache.org/jira/secure/Administrators.jspa
>>>> -
>>>> For more information on JIRA, see:
>>>>    http://www.atlassian.com/software/jira
>>


Re: [jira] Assigned: (MODPYTHON-59) Add get_session() method to request object

Posted by "Gregory (Grisha) Trubetskoy" <gr...@apache.org>.
I'm -1 on get_session() too. The request object is supposed to be a 
representation of Apache's request, and get_session() just does not belong 
there.

Grisha

On Sun, 12 Mar 2006, Jim Gallacher wrote:

> I handn't really intended to start working on an implementation. I just don't 
> like seeing all those issues in JIRA marked as unassigned. :) Since I created 
> it I figured I should take some responsibility for it. Plus, it's a gentle 
> reminder when I list my assigned issues - resolve it one way or another.
>
> I still think we need some sort of solution to the problem of people trying 
> to create 2 session instances in the same request, but I agree that the 
> original concept of req.get_session() was not quite right.
>
> Jim
>
> Graham Dumpleton wrote:
>> I would rather we not go ahead with adding req.get_session() at
>> this time. At least not how it was envisaged to be done previously.
>> 
>> I'll come back with a bit of analysis after I review where we were
>> up to previously.
>> 
>> Graham
>> 
>> On 12/03/2006, at 8:47 AM, Jim Gallacher (JIRA) wrote:
>> 
>>>      [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]
>>> 
>>> Jim Gallacher reassigned MODPYTHON-59:
>>> --------------------------------------
>>> 
>>>     Assign To: Jim Gallacher
>>> 
>>>> Add get_session() method to request object
>>>> ------------------------------------------
>>>> 
>>>>          Key: MODPYTHON-59
>>>>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>>>>      Project: mod_python
>>>>         Type: New Feature
>>>>   Components: session
>>>>     Versions: 3.1.4, 3.1.3, 3.2.7
>>>>  Environment: All
>>>>     Reporter: Jim Gallacher
>>>>     Assignee: Jim Gallacher
>>>>      Fix For: 3.3
>>>>  Attachments: Session.py.diff.txt
>>>> 
>>>> Users will get session instances by calling req.get_session(). If a 
>>>> session already exists it will be returned, otherwise a new session 
>>>> instance will be created. Session configuration will be handled using 
>>>> apache directives rather than within their code.
>>>> Using this scheme means only one session instance will be created per 
>>>> request, which will eliminate the deadlock problems many people 
>>>> experience. Also, using this scheme makes it possible for sessions to 
>>>> be properly handled within psp pages and across 
>>>> req.internal_redirect() calls.
>>>> Code will be commited to svn shortly.
>>> 
>>> 
>>> -- 
>>> This message is automatically generated by JIRA.
>>> -
>>> If you think it was sent incorrectly contact one of the administrators:
>>>    http://issues.apache.org/jira/secure/Administrators.jspa
>>> -
>>> For more information on JIRA, see:
>>>    http://www.atlassian.com/software/jira
>> 
>> 
>> 
>

Re: [jira] Assigned: (MODPYTHON-59) Add get_session() method to request object

Posted by Jim Gallacher <jp...@jgassociates.ca>.
I handn't really intended to start working on an implementation. I just 
don't like seeing all those issues in JIRA marked as unassigned. :) 
Since I created it I figured I should take some responsibility for it. 
Plus, it's a gentle reminder when I list my assigned issues - resolve it 
one way or another.

I still think we need some sort of solution to the problem of people 
trying to create 2 session instances in the same request, but I agree 
that the original concept of req.get_session() was not quite right.

Jim

Graham Dumpleton wrote:
> I would rather we not go ahead with adding req.get_session() at
> this time. At least not how it was envisaged to be done previously.
> 
> I'll come back with a bit of analysis after I review where we were
> up to previously.
> 
> Graham
> 
> On 12/03/2006, at 8:47 AM, Jim Gallacher (JIRA) wrote:
> 
>>      [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]
>>
>> Jim Gallacher reassigned MODPYTHON-59:
>> --------------------------------------
>>
>>     Assign To: Jim Gallacher
>>
>>> Add get_session() method to request object
>>> ------------------------------------------
>>>
>>>          Key: MODPYTHON-59
>>>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>>>      Project: mod_python
>>>         Type: New Feature
>>>   Components: session
>>>     Versions: 3.1.4, 3.1.3, 3.2.7
>>>  Environment: All
>>>     Reporter: Jim Gallacher
>>>     Assignee: Jim Gallacher
>>>      Fix For: 3.3
>>>  Attachments: Session.py.diff.txt
>>>
>>> Users will get session instances by calling req.get_session(). If a 
>>> session already exists it will be returned, otherwise a new session 
>>> instance will be created. Session configuration will be handled using 
>>> apache directives rather than within their code.
>>> Using this scheme means only one session instance will be created per 
>>> request, which will eliminate the deadlock problems many people 
>>> experience. Also, using this scheme makes it possible for sessions to 
>>> be properly handled within psp pages and across 
>>> req.internal_redirect() calls.
>>> Code will be commited to svn shortly.
>>
>>
>> -- 
>> This message is automatically generated by JIRA.
>> -
>> If you think it was sent incorrectly contact one of the administrators:
>>    http://issues.apache.org/jira/secure/Administrators.jspa
>> -
>> For more information on JIRA, see:
>>    http://www.atlassian.com/software/jira
> 
> 
> 


Re: [jira] Assigned: (MODPYTHON-59) Add get_session() method to request object

Posted by Graham Dumpleton <gr...@dscpl.com.au>.
I would rather we not go ahead with adding req.get_session() at
this time. At least not how it was envisaged to be done previously.

I'll come back with a bit of analysis after I review where we were
up to previously.

Graham

On 12/03/2006, at 8:47 AM, Jim Gallacher (JIRA) wrote:

>      [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]
>
> Jim Gallacher reassigned MODPYTHON-59:
> --------------------------------------
>
>     Assign To: Jim Gallacher
>
>> Add get_session() method to request object
>> ------------------------------------------
>>
>>          Key: MODPYTHON-59
>>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>>      Project: mod_python
>>         Type: New Feature
>>   Components: session
>>     Versions: 3.1.4, 3.1.3, 3.2.7
>>  Environment: All
>>     Reporter: Jim Gallacher
>>     Assignee: Jim Gallacher
>>      Fix For: 3.3
>>  Attachments: Session.py.diff.txt
>>
>> Users will get session instances by calling req.get_session(). If a 
>> session already exists it will be returned, otherwise a new session 
>> instance will be created. Session configuration will be handled using 
>> apache directives rather than within their code.
>> Using this scheme means only one session instance will be created per 
>> request, which will eliminate the deadlock problems many people 
>> experience. Also, using this scheme makes it possible for sessions to 
>> be properly handled within psp pages and across 
>> req.internal_redirect() calls.
>> Code will be commited to svn shortly.
>
> -- 
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira


[jira] Assigned: (MODPYTHON-59) Add get_session() method to request object

Posted by "Jim Gallacher (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-59?page=all ]

Jim Gallacher reassigned MODPYTHON-59:
--------------------------------------

    Assign To: Jim Gallacher

> Add get_session() method to request object
> ------------------------------------------
>
>          Key: MODPYTHON-59
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-59
>      Project: mod_python
>         Type: New Feature
>   Components: session
>     Versions: 3.1.4, 3.1.3, 3.2.7
>  Environment: All
>     Reporter: Jim Gallacher
>     Assignee: Jim Gallacher
>      Fix For: 3.3
>  Attachments: Session.py.diff.txt
>
> Users will get session instances by calling req.get_session(). If a session already exists it will be returned, otherwise a new session instance will be created. Session configuration will be handled using apache directives rather than within their code.
> Using this scheme means only one session instance will be created per request, which will eliminate the deadlock problems many people experience. Also, using this scheme makes it possible for sessions to be properly handled within psp pages and across req.internal_redirect() calls.
> Code will be commited to svn shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira