5 Replies - 2971 Views - Last Post: 05 December 2011 - 10:41 AM Rate Topic: -----

#1 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

what is the maximum size of a session variable

Posted 05 December 2011 - 02:03 AM

Hi all,

I want to know whthere there is a maximum limit of session variable. I google but cudnt find it.

cheers...
Is This A Good Question/Topic? 0
  • +

Replies To: what is the maximum size of a session variable

#2 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,205
  • Joined: 19-January 10

Re: what is the maximum size of a session variable

Posted 05 December 2011 - 02:07 AM

It's in your php.ini
Was This Post Helpful? 1
  • +
  • -

#3 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3718
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: what is the maximum size of a session variable

Posted 05 December 2011 - 02:55 AM

View Postcreativecoding, on 05 December 2011 - 09:07 AM, said:

It's in your php.ini

Are you sure? I checked all the session related ini directives in the manual and none seemed relevant to this.

As far as I am aware, there is no limit to the size of a session, given that it doesn't cause PHP to run out of the limited amount of memory it can use.

Of course, a session so large it starts warranting this question is probably large enough to start causing performance hits. The IO operations required to open and close a large session can take their toll. - It's better to store data that is not used frequently in a database or even just dumped into a temporary file, so it won't have to be read and written for every request.
Was This Post Helpful? 1
  • +
  • -

#4 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

Re: what is the maximum size of a session variable

Posted 05 December 2011 - 03:22 AM

thanks all,

in my web site I have header, content then footer php files.
I wanted to handle banner data in header.php via the controle pannel. I tried to get data from database and try to load it in header.php . I use codeninigter frame work. .
therefore when header is first loaded it show error since databse is not print data in header. All php goes in the content.php so , I thought to use session. it works now. but I have lot of text to set to session. Then, I wanted to know whther there is any limitation to avoid crashes.

If you have any better option plz let me know.

thx again!!!

This post has been edited by menukadevinda: 05 December 2011 - 03:25 AM

Was This Post Helpful? 0
  • +
  • -

#5 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3718
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: what is the maximum size of a session variable

Posted 05 December 2011 - 03:59 AM

View Postmenukadevinda, on 05 December 2011 - 10:22 AM, said:

therefore when header is first loaded it show error since databse is not print data in header. All php goes in the content.php so , I thought to use session.

That doesn't make sense. Why can you use a session in your header but not a database?
Could you perhaps show us the code that is doing this?
Was This Post Helpful? 0
  • +
  • -

#6 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,205
  • Joined: 19-January 10

Re: what is the maximum size of a session variable

Posted 05 December 2011 - 10:41 AM

@atli, I misread it and thought he was referring to the default cookie expiration time for the session id.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1