I need to reset the session identifier once user logs in to the application. But I have tried for several days, but still cannot reset jsessionid cookie and if it does, the server seems not recognize it. Could someone please provide some suggestion or some code examples?
Here is the code in login_action.cfm where login.cfm submit the form to: login form submit user credential to login_action.cfm. here is the code in login_action.cfm:
<cfcookie name="JSESSIONID" value="0" expires="now">
<cfif IsDefined('cookie.JSESSIONID')>
<cfheader name="Set-Cookie" value="JSESSIONID=0;expires=#GetHttpTimeString(CreateODBCDateTime(now()))#;path=/;HTTPOnly;secure=true;">
</cfif>
<cfset structclear(session)>
<cfhttp url="loginverify.cfm" method="post" >
<cfhttpparam name="username" value="#form.username#" type="formfield" ><cfhttpparam name="password" value="#form.password#" type="formfield" >
</cfhttp>
<cfset cookieval = "#MID(cfhttp.responseheader['set-cookie'][1], 12, findnocase(";", cfhttp.responseheader['set-cookie'][1])-13)#">
<cfheader name="Set-Cookie" value="#cfhttp.responseheader['set-cookie'][1]#">
<cfset cookie.jsessionid = cookieval>
<cflocation url="myfirstpage.cfm" addtoken="no">
here is the code to authenticate the user in loginverify.cfm:
<!--- authenticate users --->
<!--- if user passed--->
<cfset session.gooduser = true>
<cfset session.userpermission = 1>
but it seems the session variables defined in loginverify.cfm is not recognized in login_action.cfm
.
Any suggestion?
Thanks a lot.
<cfcookie name="JSESSIONID" value="0" expires="now"> <cfif IsDefined('cookie.JSESSIONID')> <cfheader name="Set-Cookie" value="JSESSIONID=0;expires=#GetHttpTimeString(CreateODBCDateTime(now()))#;path=/;HTTPOnly;secure=true;"> </cfif> <cfset structclear(session)> <cfhttp url="loginverify.cfm" method="post" > <cfhttpparam name="testParam" value="test" type="formfield" > </cfhttp>– Lin Jan 20 '12 at 20:32