Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if Session still exists

On the time of login, coldfusion server assigns me a CFID and a CFTOKEN. Later on using those CFID and CFTOKEN how can I check if my session still exists or not.

In other words I want a function that will take CFID and CFTOKEN and will tell if the session related to those CFID and CFTOKEN still exists or not.

Thanks

like image 954
Adil Malik Avatar asked Jan 22 '26 10:01

Adil Malik


1 Answers

The easiest way to achieve this would be to set a flag in the session when your user logs in.

for example

<cfset session.loggedin = true />

then when you want to check if the user still has a valid session you can do

<cfparam name="session.loggedin" default="false" />
<cfif NOT session.loggedin>
  <!--- do something here --->
</cfif>
like image 68
Chris Blackwell Avatar answered Jan 25 '26 13:01

Chris Blackwell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!