librelist archives

« back to archive

[flask] Can flask use session without cookie?

[flask] Can flask use session without cookie?

From:
何威威
Date:
2010-07-02 @ 10:27
There are two ways implement session, cookie and url rewrite. Flask use
cookie do it. Does it can do with url rewrite ?

Django can do that using a middleware, what about flask?

Re: [flask] Can flask use session without cookie?

From:
Armin Ronacher
Date:
2010-07-02 @ 10:39
Hi,

On 7/2/10 12:27 PM, 何威威 wrote:
> There are two ways implement session, cookie and url rewrite. Flask use
> cookie do it. Does it can do with url rewrite ?
You could implement it, but I would recommend against that because of 
safety concerns.  Sessions could be stolen from the Referrer header, and 
accidentally by copy/pasting URLs away.

If you want to implement that, that's possible and in fact very easy, 
but I would not recommend it.


Regards,
Armin

Re: [flask] Can flask use session without cookie?

From:
Armin Ronacher
Date:
2010-07-02 @ 11:10
Hi,

On 7/2/10 12:39 PM, Armin Ronacher wrote:
> If you want to implement that, that's possible and in fact very easy,
> but I would not recommend it.
Here an example implementation that handles the most common cases: 
redirects, form submissions and most regular links:
   http://bit.ly/9dEViI

Regards,
Armin

Re: [flask] Can flask use session without cookie?

From:
何威威
Date:
2010-07-02 @ 11:43
Thanks Armin. Your code gives me useful references.

2010/7/2 Armin Ronacher <armin.ronacher@active-4.com>

> Hi,
>
> On 7/2/10 12:39 PM, Armin Ronacher wrote:
> > If you want to implement that, that's possible and in fact very easy,
> > but I would not recommend it.
> Here an example implementation that handles the most common cases:
> redirects, form submissions and most regular links:
>   http://bit.ly/9dEViI
>
> Regards,
> Armin
>