Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session is invalid

Status
Not open for further replies.

Bammy217

Programmer
Sep 28, 2002
74
BE
Hey all,

we are experiencing some issues with a module in our CF Application, we offer our users a verity search, for some (unknown reason) if the user enters, then exits then enters the search again the entire server goes mad... it displays us a message stating "Session is invalid"

the way the search works:

the actual search routine
Code:
    <cfset sCollectionName = "verCol_#session.user.org_reference#" />
    <cfsearch collection="#sCollectionName#" criteria="#form.criteria#" name="qVerityResults">
    <cfif Not qVerityResults.recordCount>
        <cfset session.tmp.errorMessage = "No results found, please try again" />
        <cflocation url="searchform.cfm" addToken="no">
    <cfelse>
        <cfset session.tmp.verity = qVerityResults />
        <cflocation url="searchresults.cfm" addToken="no">
    </cfif>

The clearing of the results
Code:
    <cfparam name="url.followUp" default="searchform">
    <!--- clear the result set --->
    <cfset session.tmp.verity = "" />
    <!--- send user to follow up location --->
    <cflocation url="#url.followUp#.cfm" addToken="no">

As you can see the issue of the session going invalid is obviously related to the setting and resetting of #session.tmp.verity#; however this makes no sense...

When we started to have this issue we have tried the following ways to avoid the issue:

Code:
    <cfset StructDelete(session.tmp,"verity") />
    <cfset session.tmp.verity = "" />

AND

Code:
    <cfset StructDelete(session.tmp,"verity") />
    <cfset session.tmp.verity = QueryNew("col,col2,col3") />

AND

Code:
    <cfset cl = session.tmp.verity.columnList />
    <cfset StructDelete(session.tmp,"verity") />
    <cfset session.tmp.verity = QueryNew(cl) />

However in all scenario's, when the user enters the search for the second time in one session the session is declared invalid.

This would not be so much of a problem, however as this issue affects all sessions of the application (e.g. happens to all users when one user triggers it) it is seriously ruining our lives. The only way we have found to reset the sessions is one of the following 2 solutions:
1) Re-start the CF Application Server
2) change the ApplicationName in Application.cfc

If there is anyone out there who has had this before, please help!!

Many thanks,
B.

We never fail, we just find that the path to succes is never quite what we thought...
 
Try placing a CFLOCK around any code that sets a session variable. I have seen a variety of issues occur when this is not done. Start with this and see if it fixes your issue.
 
My first thought would have been a problem with the combination of cflocation and session variables. In some versions there were issues that relate to session variables using cookies as the default storage mechanism, IIRC.


However, the "Session is invalid" error suggests it might be another issue. A brief google on ColdFusion "Session is invalid" turned up these links:


----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top