10138 Users read it.

Username Session variable KT_Username(MM_Username)

by Bill Chalmers (February 12, 2002)

Using the stock phakt code I couldn't request the session variable KT_Username on subsequent pages, this shows you the easy fix.

User Rating (18 votes)
3 reviews available | Read all reviews »

Normally when you use a server models login behaviour in ultradev it creates some code which creates a session variable if the login was sucsessful, this can be used to filter things on subsequent pages.

In ASP the session variable is called MM_Username and in PHP it is called KT_Username.

This worked fine for me in ASP but not PHP, I couldn't seem to retrieve the session variable KT_Username on subsequent pages and spent ages looking for the answer, I also noticed that several other people were having the same problem, the answer is simple.

Make sure this code:

<?php
session_start();
?>

is on any and every page where you want to retrieve the session variable KT_Username.

Bill Chalmers

Bill ChalmersStarted doing sites in Frontpage about 3 years ago, progressed to ASP, Linux/Mysql, and PHP/MYSQL, currently learning LDAP, XML, XHTML, ASP.net, learning more about css, worked in Hammersmith Hospital for 8 years, Developed

www.hammersmithresearch.com
www.cafenetix.com
www.hammersmithcafe.org

Also developed the Trusts Intranet site with lots of php/asp applications built in, content management, enjoy getting paid for mucking about with stuff I do as a hobby.

See All Postings From Bill Chalmers >>

User Reviews

Total of 3 reviews
Something to be aware if usinh PHP on a Windows platform
Written by Mark Pawson on April 19, 2002

If you experience problems that new SID's are being created after using phakt / impakt code then this may prove a solution. - Thanks to Cirstoiu & the Interakt team for providing prompt feedback to all emails sent whilst discovering the ...

OK????
Written by Bill Chalmers on March 18, 2002

While this is true the stock restrict access to page and other built in user authentication features do request the stock variable name so it may be wise to use this unless you are doing your own hand coding and want to explicitly create your own ...

Session Variable Username
Written by Andrew Watson on March 18, 2002

Just a wee point, The session variable username is only called MM_Username if you use the stock UD login behaviour, its not generic to ASP, it can be called anything in the whole wide world.... <%= ...

Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency