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.

Multiple Session Problem

Featured Replies

Hi

I'm having a problem with my sessions. When developing locally, my scripts work fine - but on the server they aren't passing the session data correctly. I'm having to use ini_set to save cookies in a specific directory on the host. When I move to the second script, using a header:Location protocol - it generates a new session that is empty.

 

In a nutshell:

 

//script1.........................

ini_set('session.save_path','./session/');
session_start();
$_SESSION['message'] = 'blah';

 

Then on another page

ini_set('session.save_path','./session/');
session_start();
if (isset($_SESSION['message'])
{
$msg = $_SESSION['message'];
echo "$msg";
}
else
{
echo "**** GRRRRRRR!!! AAAAAAAGHG!! the sessions still not working....";
}

 

I've taken a look at using session_name, but while I can figure out how to derive or retrieve a session_name (or session_id), I can't figure out how to force the second script to access the session I want.

  • Author

Doh!!

Managed to solve this one - it's the header. The header uses Location:'http://domainname' - and by omitting the 'www' it is seen as a different/sub domain, thus generating a new session.

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.