EasyCFM.COM ColdFusion Forums / Coding Help! / Session.Username Each Page

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Session.Username Each Page -- page: 1 2 3

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

enervate
08-13-2003 @ 4:40 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 5
Joined: Aug 2003

I have a login that works fine, i also have an index page that displays welcome guest or #session.username# depending on their login status. This also works fine. The only problem im having is getting the session to stay alive on each page. I have the welcome section on every page of the site, but every time you move off the index page, it loses the session, and reverts back to syaing guest. Any help would be great.

DesertTRD
08-13-2003 @ 4:58 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 3
Joined: Aug 2003

?cfid=#cfid#&cftoken=#cftoken#

you need to tell it what the token is.  

CJ
08-13-2003 @ 5:28 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4262
Joined: Oct 2002

can you post your application.cfm code?  have you enabled sessions?

do any other session variables exist?  are any others getting lost as well?



CJ
@ #coldfusion/DALNet
http://charlie.griefer.com

enervate
08-14-2003 @ 11:29 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 5
Joined: Aug 2003

i currently dont have my application.cfm, will get it tonight, but i no for a fact that sessions are enabled, otherwise my welcome guest login bit wouldnt work, just seems weird that after the first page, the session dies, and you have to go back to the login in page to log back in, but then it directs to the index page. So it aint much help. But if you need the application, i can post it tonight, thanks for helping.

CJ
08-14-2003 @ 11:53 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4262
Joined: Oct 2002

well, one of two things could be happening:

1) you're not properly setting the session variable to begin with
2) you're manually logging the user out, although you don't mean to

without seeing code, hard to troubleshoot.  so please post what you can whenever you can, and we'll see what we can do Smile  



CJ
@ #coldfusion/DALNet
http://charlie.griefer.com

enervate
08-14-2003 @ 2:06 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 5
Joined: Aug 2003

This is me application.cfm

<cfapplication name="SessionCheck"
               ClientManagement="No"
               SessionManagement="Yes"
               SessionTimeout="#CreateTimeSpan(0,0,30,0)#"
               SetClientCookies="Yes">
<CFPARAM name="session.loggedin" default="N">
<cfparam name="session.MM_Username" default="Guest">

Cheers Buddy

Webmaster
08-14-2003 @ 2:20 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

Take this out...

ClientManagement="No" (You dont need it... Wink  )
unless you are using client variables, you can also take this out:
SetClientCookies="Yes"

Thanks,
Pablo Varando

=====================================================

enervate
08-14-2003 @ 2:30 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 5
Joined: Aug 2003

cheers for that, but it still has not resolved my problem. The session only works for the first page, after moving onto another page, the session dies, and reverts back to guest. I really need to get this sorted coz its for a business, thanks

Webmaster
08-14-2003 @ 2:49 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

ok, I see how you are defining by default... but how are you defining them elsewhere?

On other words, do you have something like:

<CFSET SESSION.MM_Username = "Pablo">
or
<CFSCRIPT>
  SESSION.MM_Username = "Pablo";
</CFSCRIPT>

The session has to be defined to have a value....

Thanks,
Pablo Varando

=====================================================

enervate
08-14-2003 @ 2:54 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 5
Joined: Aug 2003

Would probably be why, only thing on my index page is this...

<cfif IsDefined("session.MM_Username")>
<cfoutput>Welcome #session.MM_Username#</cfoutput>
<cfelse>
Welcome Guest
</cfif>

thats what prints the welcome part, havnt got any other code though, could you possible just run through the cfset bit please, am new to all this lol, cheers

PAGE: 1 2 3

Website Designed and Developed by Pablo Varando.