librelist archives

« back to archive

question about session

question about session

From:
Lix Xu
Date:
2011-12-14 @ 07:28
Hi,
    Does session have size limit?
    Suppose there has a shop cart, and the website use the session to store
cart items, such shopping products.
    I mean whether the session can hold all the products (may be hundreds).
    Thanks.

Re: [flask] question about session

From:
linnchord
Date:
2011-12-14 @ 08:54
flask store session in cookie, there's limited size in browser (chrome
default set 4KB). So you can not store too much data in it.

Maybe you can store it in session on server side. But from  performance and
design point view, that's not a good idea.


在 2011-12-14 下午3:29,"Lix Xu" <xuzenglin@gmail.com>写道:
>
> Hi,
>     Does session have size limit?
>     Suppose there has a shop cart, and the website use the session to
store cart items, such shopping products.
>     I mean whether the session can hold all the products (may be
hundreds).
>     Thanks.

Re: [flask] question about session

From:
Eka (Esteban Feldman)
Date:
2011-12-14 @ 10:13
Try beaker, it stores server side, and imho is a good way to handle it.
El 14/12/2011 05:56, "linnchord" <linnchord@gmail.com> escribió:

> flask store session in cookie, there's limited size in browser (chrome
> default set 4KB). So you can not store too much data in it.
>
> Maybe you can store it in session on server side. But from  performance
> and design point view, that's not a good idea.
>
>
> 在 2011-12-14 下午3:29,"Lix Xu" <xuzenglin@gmail.com>写道:
> >
> > Hi,
> >     Does session have size limit?
> >     Suppose there has a shop cart, and the website use the session to
> store cart items, such shopping products.
> >     I mean whether the session can hold all the products (may be
> hundreds).
> >     Thanks.
>

Re: [flask] question about session

From:
Eka (Esteban Feldman)
Date:
2011-12-14 @ 10:14
http://beaker.readthedocs.org/en/latest/index.html
El 14/12/2011 07:13, "Eka (Esteban Feldman)" <ekagaurangadas@gmail.com>
escribió:

> Try beaker, it stores server side, and imho is a good way to handle it.
> El 14/12/2011 05:56, "linnchord" <linnchord@gmail.com> escribió:
>
>> flask store session in cookie, there's limited size in browser (chrome
>> default set 4KB). So you can not store too much data in it.
>>
>> Maybe you can store it in session on server side. But from  performance
>> and design point view, that's not a good idea.
>>
>>
>> 在 2011-12-14 下午3:29,"Lix Xu" <xuzenglin@gmail.com>写道:
>> >
>> > Hi,
>> >     Does session have size limit?
>> >     Suppose there has a shop cart, and the website use the session to
>> store cart items, such shopping products.
>> >     I mean whether the session can hold all the products (may be
>> hundreds).
>> >     Thanks.
>>
>

Re: [flask] question about session

From:
kracekumar ramaraju
Date:
2011-12-14 @ 13:58
Hi

 You should take a look at it http://flask.pocoo.org/snippets/75/.

*Note: *Redis in memory NoSQL. If you use redis as session storage you will
have to think about your RAM usage. If your site will have 100 users online
simultaneously you need to benchmark the memory usage.

You can set expire option for every key.

You can use an YAML based session.
Regards
Kracekumar
"Talk is cheap, show me the code" -- Linus Torvalds.