Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 102977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:03:03+00:00 2026-05-11T01:03:03+00:00

I currently have a custom session handler class which simply builds on php’s session

  • 0

I currently have a custom session handler class which simply builds on php’s session functionality (and ties in some mySQL tables).

I have a wide variety of session variables that best suits my application (primarily kept on the server side). Although I am also using jQuery to improve the usability of the front-end, and I was wondering if feeding some of the session variables (some basics and some browse preference id’s) to a JS object would be a bad way to go.

Currently if I need to access any of this information at the front-end I do a ajax request to a php page specifically written to provide the appropriate response, although I am unsure if this is the best practice (actually I’m pretty sure this just creates a excess number of Ajax requests).

Has anyone got any comments on this? Would this be the best way to have this sort of information available to the client side?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:03:03+00:00Added an answer on May 11, 2026 at 1:03 am

    I really guess it depends on many factors. I’m always having ‘premature optimization …’ in the back of my head.

    In earlier years I rushed every little idea that came to my mind into the app. That often lead to ‘i made it cool but I didn’t took time to fully grasp the problem I’m trying to solve; was there a problem anyway?’

    Nowadays I use the obvious approach (like yours) which is fast (without scarifying performance completely on the first try) and then analyze if I’m getting into problems or not.

    In other words:

    1. How often do you need to access this information from different kind of loaded pages (because if you load the information once without the user reloading there’s probably not much point in re-fetching it anyway) multiplied by number of concurrent clients?

    2. If you write the information into a client side cookie for fast JS access, can harm be done to your application if abused (modified without application consent)? Replace ‘JS’ and ‘cookie’ without any kind of offline storage like WHATWG proposes it, if #1 applies.

    The ‘fast’ approach suits me, because often there’s not the big investment into prior-development research. If you’ve done that carefully … but then you would probably know that answer already 😉

    As 3. you could always push the HTML to your client already including the data you need in JS, maybe that can work in your case. Will be interesting to see what other suggestions will come!

    As I side note: I’ve had PHP sessions stored in DB too, until I moved them over to memcached (alert: it’s a cache and not a persistent store so may be not a good idea for you case, I can live with it, I just make sure it’s always running) to realize a average drop of 20% of database queries and and through this a 90% drop of write queries. And I wasn’t even using any fancy Ajax yet, just the number of concurrent users.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 80k
  • Answers 80k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Look into sticky windows. May 11, 2026 at 4:20 pm
  • Editorial Team
    Editorial Team added an answer The CSS 2.1 specification has an default style sheet for… May 11, 2026 at 4:20 pm
  • Editorial Team
    Editorial Team added an answer Optimize PDF Files Avoid Refried Graphics For graphics that must… May 11, 2026 at 4:20 pm

Related Questions

I currently have a custom session handler class which simply builds on php's session
I am currently trying to refactor my codebase for an app I am making,
At the company I work for, I have created a Error Logging class to
I'm trying to decide on the best strategy for accessing the database. I understand
Our SSO login process uses Forms Authentication against a custom user store in SQL

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.