locked
Quick Session Question RRS feed

  • Question

  • User442013226 posted

    Hi everyone,

    I have 9 administrators on one of my internal sites. There will probably be no more than 3 logged in at any one time. I have the following data for them that I would like to use across their entire session.

    Name: string

    Color: string

    Id: int

    CMS: bool

    UMS: bool

    EMS: bool

    So considering the fact that about no more than 3 will be logged in at any time, is this data suitable to store in the Session object for 3 users? Also, does manually added session data need to be manually cleared or will it clear when the Session expires?

    Thanks

     

     

     

     

    Thursday, March 17, 2011 3:58 PM

Answers

  • User551462331 posted

    session can be used efficiently for far more data and more users... so, u can definatly use session here..

    once one of the admin login, session data can be created for his session... and it will persist till either he log off or session expires after time out (by default 20 minutes)

    session is valid for only single user, no other user can see session data of other user. so, if u r looking for this values to be shared for all user who are logged in, then u have to think of using application variable or static variable or some storage (database, file etc.)

    hope this helps...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 17, 2011 4:12 PM
  • User551462331 posted

    of course use of session should be avoided for perfomance benefit....

    but in this case, u r using simple variables (i doubt u want to store heavy/long string in variable "Name") to store in session with very low number of users

    session is adviced to avoid to store large data like dataset table etc.

    in this scenario it makes more sense to use session variable rather than any other way..

    hope this helps...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 17, 2011 5:28 PM
  • User-610330605 posted

    As kedarrkulkarni said this is a perfect scenario to use session. User specific data, less amount of data and very few users.

    Our hosting is on shared hosting, so small processor/memory does this make any impact to your answer or is it still suitable?

    This is the tricky part. I believe that when you host in a shared hosting other applications hosted in the shared hosting can affect the performance of your application. This is because they share the same memory. If there is an application which heavily use session then it will affect your application too (even if you don't use session at all). So if you are very much worried about performance then you should go for dedicated hosting.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 17, 2011 6:05 PM

All replies

  • User551462331 posted

    session can be used efficiently for far more data and more users... so, u can definatly use session here..

    once one of the admin login, session data can be created for his session... and it will persist till either he log off or session expires after time out (by default 20 minutes)

    session is valid for only single user, no other user can see session data of other user. so, if u r looking for this values to be shared for all user who are logged in, then u have to think of using application variable or static variable or some storage (database, file etc.)

    hope this helps...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 17, 2011 4:12 PM
  • User442013226 posted

    Yes this does help thanks keda. I'm glad to hear that Session can be used to hold far more data, because I have read alot about how using Session heavily can impact your applications performance. Our hosting is on shared hosting, so small processor/memory does this make any impact to your answer or is it still suitable?

    And the data is meant to be for single users only so no sharing of the data is nessesary.

    Thursday, March 17, 2011 4:48 PM
  • User551462331 posted

    of course use of session should be avoided for perfomance benefit....

    but in this case, u r using simple variables (i doubt u want to store heavy/long string in variable "Name") to store in session with very low number of users

    session is adviced to avoid to store large data like dataset table etc.

    in this scenario it makes more sense to use session variable rather than any other way..

    hope this helps...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 17, 2011 5:28 PM
  • User442013226 posted

    Thanks!

    Thursday, March 17, 2011 5:53 PM
  • User-610330605 posted

    As kedarrkulkarni said this is a perfect scenario to use session. User specific data, less amount of data and very few users.

    Our hosting is on shared hosting, so small processor/memory does this make any impact to your answer or is it still suitable?

    This is the tricky part. I believe that when you host in a shared hosting other applications hosted in the shared hosting can affect the performance of your application. This is because they share the same memory. If there is an application which heavily use session then it will affect your application too (even if you don't use session at all). So if you are very much worried about performance then you should go for dedicated hosting.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 17, 2011 6:05 PM
  • User442013226 posted

    Hi thanks Jerry,

    Yeah it is frustrating that this will happen, but at the moment we can not afford the dedicated hosting costs but I will definitely be pressuring for it in the future (for a number of other reasons as well).

    I guess there are things I can't control like other apps on the server but I thought I should try and at least do my part to ensure I'm not using up the memory. From what I read our shared hosting seems to have what they call VRU or Virtual Resource Units, I think with this we have allocated amounts of memory / processor so I might not be affected by other users (but I'm not sure).

    Anyway thanks for the info!

    Thursday, March 17, 2011 9:21 PM