Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

Re-setting session variables

$
0
0

I'm developing an app. in CF10. It's been determined that this app. will be opened through a link that is created in a dot net app.

Users need to log in & log out through the dot net app.  To see the link, user need to log in then my CF app open up once users click that link so there is no log in/out requirement from my CF app.

The link passes a user id through url, I need to use url.userid to create CF session.userid.

 

So I created the session user id in onSessionStart in application.cfc :

<cfset session.userid = #Trim(URL.userid)#>

 

The problem is, when I log out and log back in as a different user, my previous session.userid still exists. So I have two different session.userids.

In order to avoid this I thought I can do the following in onSessionStart in my application.cfc:

<cfset sessionInvalidate() />

<cfset session.userid = #Trim(URL.userid)#>

 

Since every time the application start CF has to go through application.cfc first my thought would be that sessionInvalidate function will run first, destroy all the existing session and then I can create a new session

But on my test unfortunately this approach does not help! I still get the older session and the new session is not created!

Am I doing it wrong????

 

Re-setting session is the only way I can stop the build up of new sessions every time I log out and log in as a different users from the same computer. But is this not possible? or should I do it in index.cfm instead of in onSessionStart in application.cfc?


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>