?
Solved

ASP Sessions Being Cleared/Modified

Posted on 2016-08-20
6
Medium Priority
?
133 Views
Last Modified: 2016-08-26
Hi there,

I have a website using classic ASP and it currently uses a lot of session variables to keep track of what is being done on several pages.  At one point, I redirect my website to PayPal to process a payment and then get PayPal to redirect back to my website.  For some reason though, it appears that the session variables get cleared/modified when the redirection to my website occurs.  Is there any reason for this?  I need to ensure these variables stay in place in the browser until the user either logs out of my website or closes the browser.  Any suggestions??

Thank you,
- Christian
0
Comment
Question by:Christian Palacios
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41763795
Are you using 'https' for the pages both before and after connecting to Paypal?
0
 

Author Comment

by:Christian Palacios
ID: 41763815
No, my website doesn't use HTTPS.  Is that clearing my sessions?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 1400 total points
ID: 41763838
Switching from 'http' to 'https' can have side effects like that.  Browsers don't carry the session data, only the cookie that identifies the session.  I would look at the cookies before and after the Paypal pages to see if they are changing.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Christian Palacios
ID: 41763843
Thank you.  I understand you have to enable cookies in your browser first.  Do all browsers have cookies turned off by default?  Do you have a way to check if a browser's cookies are disabled so I can check that?

Thanks!!
0
 
LVL 53

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 600 total points
ID: 41763862
Change your session variables to cookies and that will solve this issue and others.  Sessions in asp are in memory.  If RAM max's out, the worker process crashes and resets sessions.  If you set cookies, your app will be more stable as far as being able to track a person when they leave and come back.

I have an article on using cookies for log in, then tracking those cookies in your database.  This opens up the doors to a lot more possibility.  https://www.experts-exchange.com/articles/18259/User-Log-In-Using-A-Token.html

It should be very easy to move from session http://www.w3schools.com/asp/asp_sessions.asp to cookies http://www.w3schools.com/asp/asp_cookies.asp.   You only need to change session("something") = "abc" to response.cookies("something")="abc" to set and to get change  var1 = session("something") to var1 = request.cookies("something")
0
 

Author Closing Comment

by:Christian Palacios
ID: 41772156
Thank you for your help!  Switching to cookies solved my problem!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question