Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

MM_Username session variable not being passed on...

New Here ,
Feb 16, 2007 Feb 16, 2007
I am using the Log In User server behaviour, but when i try and call the session variable MM_Username on the following page, it doesn't seem to be there... Here's the code from the log in page...

TOPICS
Server side applications
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 16, 2007 Feb 16, 2007
Did you put:

<?php session_start(); ?>

at the top of the following page to enable sessions?


--
Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 16, 2007 Feb 16, 2007
and here is the code for the following page...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 17, 2007 Feb 17, 2007
Yeah - if i call the session variable on the same page as it is created, it appears fine, but i can't get it to appear when i move onto the next page....
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 21, 2007 Feb 21, 2007
I'm still having problems with this - I tried creating the most simple two pages i could, a log in page with two text fields and a submit button, and then a page that will display the session variable...
I can log in correctly as i am redirected to the correct page, but the session variable will not appear...

Here's the code for the two pages...

I am running Apache 2.2.4 and MySQL 5.0 - Is there perhaps any reason this might not work on my own machine?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 21, 2007 Feb 21, 2007
dhewuidhjklhdwidh wrote:
> I can log in correctly as i am redirected to the correct page, but the session
> variable will not appear...

> I am running Apache 2.2.4 and MySQL 5.0 - Is there perhaps any reason this
> might not work on my own machine?

If you're doing this on your own computer, have you set up
session.save_path correctly in php.ini?

You need to remove the semicolon from the beginning of the line and
point to a temporary folder. On most Windows systems, it should look
like this:

session.save_path "C:\WINDOWS\Temp"

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 21, 2007 Feb 21, 2007
Here's my php.ini file,



I changed the session.save_path to what you said, but still not luck...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 21, 2007 Feb 21, 2007
dhewuidhjklhdwidh wrote:
> upload_tmp_dir="C:\DOCUME~1\user\LOCALS~1\Temp\php\session"
> session.save_path="C:\WINDOWS\Temp"

Aha, you have used the PHP Windows installer. There's a bug in it, which
is described at the bottom of the tutorial on my site:

http://foundationphp.com/tutorials/php_installer.php

The installer adds its own version of session.save_path pointing to a
non-existent folder. I can't remember exactly where it is in php.ini,
but it's probably after the section you have just shown me, because it's
obviously overriding the change you have made.

The explanation in my tutorial should be sufficient, but come back if
you still have problems.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 22, 2007 Feb 22, 2007
David, thanks so much for your time and experience, i can stop banging my head off my desk now...

Cheers,

Hugh.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 15, 2009 Mar 15, 2009
Thanks David!

My version of DW CS4 is not adding the session_start code automatically. I had to manually put that in, then the pages display correctly. Is this a bug with DW or perhaps I need to update my software?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 15, 2009 Mar 15, 2009
LATEST
phcaptjim wrote:
> Thanks David!
>
> My version of DW CS4 is not adding the session_start code automatically. I
> had to manually put that in, then the pages display correctly. Is this a bug
> with DW or perhaps I need to update my software?

It is not a bug, and you do not need to update your software. Dreamweaver doesn't add the session start code to your page. I'd suggest making it a snippet, or perhaps place it into an include that you then add to every page.


--
Danilo Celic
| http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines