Jump to content

[SOLVED] unserialize raw session


jaymc

Recommended Posts

I need a function that can unserialize the contents of a session file so I can manually alter a value

Then, I need to save the file

 

This cant involve any session_start() etc as I dont want to over write the real session

 

I would prefer to do it all raw

 

Cheers

Link to comment
Share on other sites

When someone sends someone else a message I want to flash a box saying new message

 

However, I dont want to query the database every page refresh, I called SESSIONs on every page so it makes sense to manipulate them..

 

I need it this way

Link to comment
Share on other sites

yeh, but still, it accumulates 100,000's rows

 

it doesnt make sense to me to have to query that table every time you flick between a page

 

It will just hammer it

 

Im talking about optimising here.. not standard ways for small bespoke applications

Link to comment
Share on other sites

Honestly, I think you are looking at this all wrong. MySQL is built for that, how do you think this site works? or even google? They all search through databases.

 

The trick is limiting the rows, I take it not evey user will be accessing all 100,000 rows all the time. I think you need to optimize your code or DB more.

 

A simple messaging system you would only be pulling out messages for a certain user so you already limit the rows to those who are to that user or sent by that user.

 

Honestly it does make sense to query the table each time, especially if you are updating the table. Sessions are nice, but it is not a realistic example. Eventually the session data has a limit and you will slow the user down with processing time then your server will be overloaded with processing time when thousand of users are accessing/reading/writing to a file system that is not nearly as efficient as a database.

 

Trust in the database. There is a reason they are heavily used, they are quick speedy and reliable.

 

For example a site I own, blog site that is, has over 5,000 users it generates aroun 50,000 unique hits a day with over 40,000 unique blogs with over 100,000 unique comments and it runs smooth as butter.

 

If I am missing the point sorry, but I think you are breaking your brain for nothing.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.