Username Session variable KT_Username(MM_Username)
Using the stock phakt code I couldn't request the session variable KT_Username on subsequent pages, this shows you the easy fix.
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.
Comments
Session Variable Username
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....
<%= Session("svWellillbedamnedifthisaintmysessionvariableusername") %>
Leed
OK????
Something to be aware if usinh PHP on a Windows platform
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 solution.
NOTE: This is a Windows problem.
When transmitting session variables from one page to another you have to transmit the session ID first. There are three ways to do this:
1. session ID is transmitted automatically by the server when session.use_trans_sid = 1 (set in php.ini)
2. session ID is store in a cookie when session.use_cookies = 1 (set in php.ini)
3. session ID is transmitted manually by the user in the URL
In my set-up I had set session.use_trans_sid = 1 and session.use_cookies = 0 , BUT under the Windows environment session.use_trans_sid = 1 doesn't work. Therefore when calling session_start in another page the session ID is unknown and another session is created.
To resolve this problem you need to set session_set_cookies = 1
****NOTE****
session.use_trans_sid does not work under windows.
You must me logged in to write a comment.