Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8597345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:53:34+00:00 2026-06-12T00:53:34+00:00

When I do a post one of the session variables is lost in IE.

  • 0

When I do a post one of the session variables is lost in IE.

This webapp works perfectly in Chrome and Firefox.

Here is the error:

NoMethodError at / 

undefined method `include?' for nil:NilClass
file: welcometo.rb
location: xml_file_to_use 
line: 19

Here is the method that errors:

def xml_file_to_use
   groups = allowed_groups
   #Which xml file should I write to
   if (session[:location_group].include? allowed_groups[0] ) <----Line 19
    ......
end

Here is an explanation and my code:

When the users log in, session variables are set:

#Check to see if the user is authorized
auth_token = Adauth.authenticate(params[:user], params[:password])
if auth_token 
    session[:user] = params[:user]
    session[:first_name] = auth_token.first_name.tr('/"[]', '') 
    session[:location_group] = (auth_token.groups & allowed_groups)
    redirect '/'
else 
    redirect '/login'
end

Next I set variables based on these session values:

get '/' do
  if session["user"] != nil
     @first_name = session[:first_name]
     @groups = session[:groups]
     @xml_file = xml_file_to_use 
     @location = location
     erb :form
  else 
    redirect '/login'
  end

end

This part works just fine. I can tell because I use the @location variable in my view.

Here is the location method:

#Setup Location Variable
def location
  if (session[:location_group].include? allowed_groups[0] ) <-- This same code errors during a post in IE
     return 'Eagan'
   else
     return 'Chicago'
   end  
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:53:35+00:00Added an answer on June 12, 2026 at 12:53 am

    Konstantin Haase is correct that this must be a bug.

    From the link he posted I found that putting this at the top of my welcome.rb file fixes the issue:

    set :protection, except: :session_hijacking
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my code that works perfectly to post one object to my server.
This is a continuation of the post How does one access a method from
I am trying to create a simple login credentials checker (with session variables). this
I want to get possibility to select several Categories for one Post with multiple
So I have 2 different group of tags in one post, let's call them
I have a blog on something.wordpress.com , I simply want one post to ALWAYS
One per post will be great!
I'm tying to send POST data from one site to another (both sites have
Post-release, I have made one small change to one form in our development site
Based on one answer to an earlier post , I'm investigating the possibility of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.