1

i create an mvc3 razor test application and have admin area why session id change when from controller in default area i redirect to index to admin area,where change session id?

i get session id by this syntax in default controller and in admin area controller in their action Result method

i used this method in both controllers

   public ActionResult Index()
        {

            string se = System.Web.HttpContext.Current.Session.SessionID;

        return view()
      }

how can i prevent to changing session id?

motevalizadeh
  • 5,244
  • 14
  • 61
  • 108
  • can you explain it more(please) – motevalizadeh Aug 06 '12 at 10:27
  • see [this](http://stackoverflow.com/a/283341/1182982) it says.. "I've seen that happen even without MVC. If I remember correctly, ASP.NET keeps assigning new session ids until you place something into the Session variable." – Yasser Shaikh Aug 06 '12 at 11:20

1 Answers1

4

This is old but the simple answer to this is:

You have to store something in the Session, just add something in it to keep SessionID

For others Googling this :)

Mark Homer
  • 960
  • 6
  • 15