Session for WordPress and NON-WP Pages

You have a WordPress site with a directory that has non-WordPress pages. (a couple of php files)

Non-WP pages will do the function with a different non-Wordpress site and set a few session variables.

It would be helpful for WP to be able to read these variables as well, but it seems to be treating files in the / directory / (non-wp-pages) directory as a separate independent session.

I tried to start a session from Wordpress pages or non-Wordpress pages, run session_start () at the same time and test an existing session (if (! Session_id ()) {session_start ();}) on both sides.

I log out of the session id, and depending on which side (wp or NON-wp) is running it, the other just doesn't see the session. In fact, starting it in both (which should overwrite the other ???) just makes two different concurrent session IDs. And each set of pages retains its own ID, so I don't like the fact that each one gets a new reset all the time.

The session must be domain-wide and browser / user-wide, right? It should consider example.com/ and example.com/directory/ the same? Am I missing something in the sessions?

Or am I missing something in Wordpress? Is there some weirdness in WP or a setting somewhere that restricts her sessions to only those pages that WP knows about? I know that sessions are not part of the WP core, so it would be strange that this would be the case, but there is no information here.

I've tried looking for solutions, but either I'm just using search terms that are too broad, or this isn't a common problem for both wp pages and non-wp pages and sessions.

NOTES: 1. Do not assume that any plugins are causing a session. 2. Want to store it server side (no cookies). 3. Did htaccess change, but it was just rewritten for that directory (and was changed). 4. It is not possible to merge non-WP pages into WP pages, so the assumed session variables will work for the entire session.

+3


source to share





All Articles