Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Session variables.

Featured Replies

Hi people,

 

I've just been looking into using sessions instead of cookies to store log-in details and although I haven't had the time to implement a log-in script that uses sessions I'm pretty confidant I understand it.

 

There is just one question, which is pretty much irrelevant in practice but I am interested how the server-side session variables are stored? I know they are in a tmp folder on the server but what format are they stored in, is it a plain text file or something else?

 

Any insight would be great

 

Rich.

When you start a session, a sessionid is generated for that user and stored in a cookie on the viewers computer. The session data is saved on the server with the name SESS_ + sessionid

 

I found this article, which is a pretty good and should answer some of the questions you have.

  • Author
When you start a session, a sessionid is generated for that user and stored in a cookie on the viewers computer. The session data is saved on the server with the name SESS_ + sessionid

 

I found this article, which is a pretty good and should answer some of the questions you have.

 

I see so do you know what the contents of the file 'SESS_ + sessionid' is? Does it literally just contain standard php variables?

I wasn't too sure about that, but I just tried it on localhost. The variables are stored in serialized form, but are plain to read.

E.g. I stored $_SESSION['test'] as "MrBrightside" and the contents of the session file are:

test|s:12:"MrBrightside";

 

Apparently it's not standard serialization, so you can't just use unserialize() to read the values of the session file.

  • Author

Cheers for that, I haven't had the time to test it myself!

 

Obviously its not necessary to know, but is always interesting!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.